Dev Tips

Some tips and tricks related to Web development, SEO, WordPress from time to time.

Targeting a string between two slashes with PHP & Regex

December 16th, 2022

To create a regular expression that targets a string between two forward slashes (/) on either side in PHP, you can use the following pattern: This regular expression uses the preg_match() function in PHP to search for a string that is surrounded by two forward slashes. The .*? part of the pattern matches any character […]

Issue With WooCommerce Password Reset & WP Engine

May 18th, 2022

A client was having an issue resetting their password on their Woocommerce website recently. They would request a new password via WordPress’s built-in reset form, receive the email with a link to reset their password, but when they would click on the link, they would be brought back to the same page as before, going […]

How I Create Flexible Image Galleries in WordPress

July 26th, 2021

As I travel (or have travelled 🦠) a fair bit, adding image galleries to my blog was always a bit of a challenge (I’m just not a fan of using shortcodes or bloated plugins) and put me off adding blog posts about my little adventures. That is until the release of Gutenberg. Gutenberg has made […]

CSS Background Shorthand

May 14th, 2020

Short for the Background image property. div { background: url(image.svg) top left / 100% 100% no-repeat #f6f6f6; }

Order ‘post__in’ IDs by Array Index in WordPress Query

May 11th, 2020

I use ACF a lot in my projects and when I use the Post Object field to select multiple posts for use with a custom query loop, I always forget how to order based on the posts ordering in the backend. If you want to mirror the ordering position, adding in the ‘orderby’ => ‘post__in’ […]

Display All Taxonomy Terms In WordPress

May 4th, 2020

I always have to Google this, so putting it here for reference. If you want to get all of the selected taxonomy terms for a post, use this snippet. $terms = get_the_terms( $post->ID , 'taxonomy_category' ); foreach ( $terms as $term ) { echo $term->name; }

WordPress Plugins I Use On Every New Project

April 29th, 2020

I have been using WordPress for most of my client sites, as well as personal sites for donkey’s years now – at least 12, which is insane to be honest as the market for content management systems has grown wildly with lots of new options. Still, I love using the software and find the ability […]