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:

Set stored address as default for Shipping or Billing in Magento

A current project I’m working on with a client required to import 20k customers with address, contacts and profile data – a tricky task in itself. I managed it import this successfully, but noted that the addresses were set to Shipping and not Billing.  This meant that customers could not be searched or filtered from … Continued

Image Zoom on hover with pure CSS

Here’s a short snippet for getting a nice fancy zoom when hovering over an image using purely CSS3. Here’s an example:   and here’s the code: You simply need to add the class ‘img-zoom’ to any image’s container to get the effect.   Feel free to play about with the values in the zoom to … Continued

Add new admin user in WordPress from PHPMyAdmin

Similar to another post which does the same thing in OpenCart, here’s how to add a new admin-level user to WordPress – without any access to the wp-admin area. I find this useful when I’m called in to finish off an abandoned website and have no idea what the login credentials are – I’ll simply … 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