Add Bootstrap 4 Navwalker to Roots Sage 9

I had some trouble getting the Bootstrap 4 Navwalker into a new Sage Roots 9x theme. I tried the instructions seen on the navwalker page but kept getting errors and whitescreens. Eventually, here’s what I did to get it working: 1. Download the Bootstrap 4 Navwalker file and add it to the theme: https://github.com/MWDelaney/sage-bootstrap4-navwalker Be … Continued

Prevent blurry Woocommerce gallery images after 3.3 update

Woocommerce has updated a few times since, but I ran into a confusion when trying to understand how a clients product images were looking blurry as thumbnails on the product page. The Settings -> Media were set to 300×300 The Appearance -> Customize -> Woocommerce -> Product images were set to 300×300 The themes functions … Continued

Add Prefix to URL of Custom Post Type

While you can use a plugin to accomplish this, I always prefer to code this manually without the need for a plugin. To explain what we’re trying to achieve here, usually, creating a CPT (Custom Post Type) just adds this onto the site domain or where WP is installed. So normally, the URL would look … Continued

Add Facebook Comments instead of WordPress comments

With pretty much the entire population now having a Facebook profile, it can be advantageous to use Facebook tools wherever possible to encourage interaction to those who use Facebook regularly.  While there are pros and cons to using such tools, Facebook comments can be a good introduction to the benefits. The way this works, is … Continued

Calculate age from datepicker field in ACF

I have been building a member-based website recently for a client and needed to display the age on the profile page. I was using Advanced Custom Fields to build the profiles and used the datepicker field to set the date. To calculate this, use the snippet below to achieve what you need.   Note, I … Continued

Altering archive orderby or posts-per-page on custom post type

On a project recently, I was using a custom post type for locations. These consisted of places, cities and districts as a non-hierarchial cpt. Running the archive of the post type on a standard archive.php file naturally lists the posts in order of publish date – most recent displayed first.   The archive also took into … Continued

Redirect Woocommerce Multisite shop page to another URL

Here’s a snippet to switch a Multisite Woocommerce store from one store shop page to another.  Handy when you point your store Shop page to the main store from a subsite shop page.  You may have done this in the menu, but if you use breadcrumbs then this will still show the current site store … Continued

Make Bootstrap nav dropdown appear on hover

Both Bootstrap version 3 & 4’s default navigation has nav menus toggled on click enabled by default — you have to actually click the parent item to have them open/show the sub-menu, and click again to them shut.  This is fine for some applications, but the default behaviour of most navigations is to show the … Continued

Removing Related Products from WooCommerce Single Product Page

Related products on a single product page in Woocommerce can be a great way to inform customers of other similar products in yout store. Sometimes however, you may need to remove them and here’s how. Adding this snippet to your functions.php file: