Make Bootstrap 4 dropdowns appear on hover

Bootstrap is awesome. I seriously love it and always use it for project builds. And that’s either Bootstrap 3 or 4 – whatever the projects require, I’ll usually always go with BS. When it comes to dropdowns, especially so in navigation menus, I always prefer dropdown submenus to appear on hover. By default, this is … Continued

Convert WooCommerce variation dropdowns into radio buttons

I had an eCommerce project where the client wanted to display options for their products as selectable radio buttons rather than the default select dropdowns. To achieve this, we need to write two functions: 1 will grab the selected options for the product, and for each variation available, write them to a radio button input … Continued

Redirect WordPress user if not logged in

Quite often I have requirements to redirect users if they are not currently logged in to a site. This could be for numerous reasons, but a popular one would be to redirect all visitors to a coming soon page while allowing admins to login in and view the site. This is accomplished by adding the … Continued

Add code to the WordPress Head, Body and Footer without a plugin

With tracking codes and pixels able to help you track conversions and the successes of your marketing efforts, these will need to be added to each page of your site to track user journey and behaviours. While there are plugins to achieve being able to do this, I always prefer to build this into my … 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

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

Register New Sidebars in WordPress

Today, I’ll show you how to register new sidebars in WordPress, which can be used to add new widgets areas for use across a website such as in custom page templates, footers and just about anywhere. It’s a 2 step process, so let’s get started on step 1. 1. Register the sidebar In either functions.php … Continued