News & Blog

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...

PHP Function getimagesize() Failing For Local Images

April 15th, 2014 - Posted by Steve Marks to PHP, Web Development.
When working with images in a PHP script, there might come a time when you need to use the getimagesize() function in order to discover more about the image. Whether you want to know the dimensions or the filetype, using this function can get you the information you require. Earlier today ...

Update Published Date When Going From Draft to Published in WordPress

April 10th, 2014 - Posted by Steve Marks to PHP, Web Development.
The published date of a page or post in WordPress is set when the article is first added to a website. This is then used in various scenarios; ordering news articles in date order, displaying when a blog post was first added, or setting the ‘pubDate’ value in an RSS feed. An is...

Resolving the Random Zero at the End of AJAX Requests in WordPress

March 18th, 2014 - Posted by Steve Marks to Javascript / jQuery, PHP, Software, Web Development.
If you’ve ever integrated AJAX functionality into a WordPress plugin or theme, you have probably / should have used the in-built WordPress functionality that already exists. An article in the WordPress Codex explains how to do this, and demonstrates how easy it can be. I needed to do...
Give Editor Access to Plugin

How To Allow Editors Access To a Single Plugin in WordPress

February 21st, 2014 - Posted by Steve Marks to PHP, Web Development.
Sometimes the default permissions given to user roles in WordPress need to be tweaked to match the needs of a particular project. We come across this quite a lot whereby we need to hide or show various different options for different user roles. This can normally be achieved by using a plu...
acf-street-view

Advanced Custom Fields Street View in Google Map

February 5th, 2014 - Posted by Steve Marks to Javascript / jQuery, PHP, Software, Web Development.
One of the field types available with the Advanced Custom Fields plugin for WordPress is ‘Google Map‘. This allows a user to enter a location or address, then have a Google Map be output on the frontend. I worked on a site this morning that required a Google map adding, the dif...