News & Blog

Why a Custom Taxonomy Might Not Be Returned in WordPress

July 14th, 2014 - Posted by Steve Marks to PHP, Software, Web Development.
When creating a plugin or theme in WordPress there might come a time when you need to use custom taxonomies. As well as creating the taxonomies in the first place, you might need to work with them in some other way too; be this outputting them in a list, or programmatically assign a post t...

Prevent WordPress Redirecting to Nearest Matching URL

July 4th, 2014 - Posted by Steve Marks to PHP, Web Development.
WordPress comes with a nifty feature which enables it to navigate to the closest matching URL if the one typed in doesn’t exist. This reduces the chance of a user getting presented with a 404 page if they’ve slightly mistyped a page’s URL. An example of this would be; ima...

Laravel Google Maps V3 API Package

July 2nd, 2014 - Posted by Steve Marks to Javascript / jQuery, PHP, Web Development.
Almost four years have passed since I first created my Google Maps V3 API CodeIgniter library. During this time it’s been downloaded by tens of thousands of developers and is by far the most popular page on this blog. With the Laravel framework coming onto the scene over recent years...

Get Currently Selected MySQL Database with PHP

July 1st, 2014 - Posted by Steve Marks to MySQL, PHP, Web Development.
When debugging a PHP script, or when your site contains multiple MySQL connections, it can be useful to know which database your PHP script is currently connected to. In MySQL you can simply run the following query: SELECT DATABASE(); Pretty easy right? We can do exactly the same thing in ...

Debugging Why Your Comment Reply Links Aren’t Showing in WordPress

June 18th, 2014 - Posted by Steve Marks to PHP, Web Development.
Comments are a great addition to any blog powered by WordPress. Not only do they influence interaction between your users, but they can also be beneficial when it comes to SEO. With WordPress’ built in capabilities to handle comments, adding them to any blog post or news article is r...

How to Load jQuery in the Footer of a WordPress Website

June 6th, 2014 - Posted by Steve Marks to Javascript / jQuery, PHP, Software, Web Development.
If you’re familiar with building WordPress sites that use jQuery you may have seen it included using the following method in the header of a website: wp_enqueue_script('jquery'); wp_head(); You enqueue the script and then when wp_head() is called, the jQuery library will be loaded fo...

How To Bulk Delete Product Variations in WooCommerce

June 3rd, 2014 - Posted by Steve Marks to MySQL, PHP, Software, Web Development.
When building any kind of E-Commerce site in WordPress I always have, and will for the foreseeable future, use the fantastic WooCommerce plugin. I’ve blogged about WooCommerce a few times in the past as I’ve come across various special requirements. Today is no different as I d...

How to Sort an Array by Date using PHP

May 24th, 2014 - Posted by Steve Marks to PHP, Web Development.
Recently I was working on a date-based script that needed to obtain a list of items and sort them by date. In my scenario it was a list of files and I needed to arrange them by their last modified date. The first prerequisite is that the key part of the array contains the date [...]...

Querying Posts Using AJAX In WordPress Returns All Posts

May 22nd, 2014 - Posted by Steve Marks to Javascript / jQuery, PHP, Web Development.
I’ve found myself doing a lot of work recently with AJAX requests in WordPress. Today was no different when I was tasked with implementing an infinite scroll onto a blog. The user would scroll and the next set of posts would be pulled in when the user reached the bottom. Initially I ...

Taking Your WordPress Development To The Next Level

April 16th, 2014 - Posted by Steve Marks to Miscellaneous, MySQL, PHP, Software, Web Development.
Having been an avid web developer for over 10 years now I’ve seen a lot of change during this time. One of which is the explosion in the use of WordPress Content Management System. About 90% of sites we design and build today are based on WordPress, and I’d probably be right in...