News & Blog

Add Reply, Retweet and Favourite Buttons To Custom PHP Twitter Feed

June 1st, 2016 - Posted by Steve Marks to (X)HTML / CSS, PHP, Web Development.
Something we do quite often on sites is add a Twitter feed to a client site displaying the latest tweets made by that company. Depending on the platform we might do this using a plugin, or create a bespoke PHP script to obtain the tweets. When doing a Twitter feed integration recently we w...

Get Image Alt, Caption, Description and More From Attachment ID in WordPress

December 1st, 2015 - Posted by Steve Marks to PHP, Web Development.
Whilst working on a WordPress site recently I had a scenario where I had an image attachment ID and needed to get the alt, plus other information, about the image. Oddly, I found it very difficult to obtain this information. There are lots of functions available in WordPress to get the ima...

How To Send Emails in WordPress using Gmail SMTP

October 27th, 2015 - Posted by Steve Marks to PHP, Software, Web Development.
The majority of the time we will send emails from enquiry forms using the servers’ built-in mail functionality. This means using the PHP mail() function, or letting WordPress use the mail() function behind the scenes. 99 percent of the time this works fine, however we do sometimes co...

Import Frickin’ Huge XML Files With XMLReader and SimpleXML

October 25th, 2015 - Posted by Steve Marks to PHP, Web Development.
We work with a lot of estate agent sites in our day-to-day operations. One of the tasks we normally need to incorporate into our building of these sites is importing the agent’s properties from a third party source. Depending on the software the estate agent uses this can be in a var...

Obtain PostID From Within the wpcf7_before_send_mail CF7 Hook

August 2nd, 2015 - Posted by Steve Marks to PHP, Web Development.
We use the Contact Form 7 Plugin on pretty much every WordPress site we build that requires a form of some kind. On some occasions we’re required to hook into the sending of the form to do something prior to the actual email being sent out. Fortunately the plugin comes with a handy h...

How To Install SOAP for PHP on a 1&1 VPS

July 30th, 2015 - Posted by Steve Marks to PHP, Server Management, Web Development.
If working with a third party service it’s possible that you might need to communicate with it using SOAP. This is exactly the scenario we found ourselves in today. The issue was however that the 1&1 VPS that the site was hosted on didn’t have SOAP, and inparticular SOAPCl...

Sorting a PHP Array with a Key of Decimal Type

April 28th, 2015 - Posted by Steve Marks to PHP.
There are many PHP functions available that assist with sorting arrays. The one we’ll be talking about in this article is the ksort() function which is intended to sort an array by key. Now, to sort an array where the keys are of type decimal you would ordinarily think the following ...

Solving Error “ERROR 1 (HY000): Can’t create/write to file ‘/tmp/#sql_9f3_0.MYI’ (Errcode: 17)”

March 31st, 2015 - Posted by Steve Marks to MySQL, PHP, Web Development.
Recently a site that we manage stopped working all of a sudden. The error being returned from the MySQL query was as follows: ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_9f3_0.MYI' (Errcode: 17) The error states that a file in the ‘/tmp/’ folder can’t be writte...

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