News & Blog

Removing the Query String from $_SERVER[‘REQUEST_URI’] in PHP

December 16th, 2014 - Posted by Steve Marks to PHP, Web Development.
When trying to get the current request URI in a PHP file you would normally use: echo $_SERVER['REQUEST_URI']; When recently using this however I found that it could also contain the current query string. After digging a bit deeper it turns that the addition of the query string can differ ...

Add Character Between Menu Items in WordPress using wp_nav_menu() Function

November 26th, 2014 - Posted by Steve Marks to PHP, Web Development.
Allowing navigation menus to be controlled from within WordPress makes amending the sites structure a simple task for the user. When setting up a menu you’d normally register it in your theme’s functions.php file then output it using the wp_nav_menu() function. Most of the time...

Resolving Error with Sending Emails via SMTP Using CodeIgniter

November 18th, 2014 - Posted by Steve Marks to PHP, Web Development.
When sending emails using the CodeIgniter Email Class, I’ve always just kept the protocol as ‘mail‘ meaning emails get sent using the standard PHP mail() function. Recently however, on an application we had been developing, emails were a critical part of the system. We ha...

Limit WooCommerce Product Quantity to One

October 23rd, 2014 - Posted by Steve Marks to PHP, Software, Web Development.
Sometimes you might want to restrict customers of a WooCommerce site from purchasing more than one of any product. Fortunately this is made simple through use of the options already available in WooCommerce. Simply edit the product in question, navigate to the ‘Inventory’ tab a...

Remove Whitespace Between List Items Generated By wp_nav_menu()

September 26th, 2014 - Posted by Steve Marks to (X)HTML / CSS, PHP, Web Development.
Earlier today I was using wp_nav_menu() function within WordPress to output a navigation menu on a site. I was getting an issue however whereby the whitespace between the list items (<li>) was causing spaces between the menu items on the frontend. My list items had the ‘display...

Change Author Base URL in WordPress Permalinks

August 26th, 2014 - Posted by Steve Marks to PHP, Web Development.
By default when viewing a user’s profile page on the front end of a WordPress site, the URL will looks something like so: http://mysite.com/author/joe-bloggs The base URL will be ‘author’ followed by the users name. This is fine and works if users in the system are author...

WordPress Plugin Released: Link Picker Field for Advanced Custom Fields

July 25th, 2014 - Posted by Steve Marks to PHP, Web Development.
We’re pleased to announce the release of our fourth WordPress plugin; an add-on field for the already established Advanced Custom Fields plugin. Download on WordPress > View Github repository > In the standard ACF plugin there are a few ways to allow a user to select a link: 1....

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