Currently Browsing The Snippets Category

Custom excerpt length & Read More link WordPress

Posted on 26th May, 2014 3 Comments

I often want to use a custom excerpt length in my themes. Custom excerpts can be really useful whether they are being used for the archives, home page or even when being used in meta description! Being able to add just the right amount of copy to a section is easy with this snippet. New…






Redirecting with the .htaccess

Posted on 23rd May, 2014 Leave a Comment

To redirect www to non www add this to your htaccess file. To redirect all sub-domains to the main domain use this. To redirect a single sub-domain use this. Redirect a single url/folder path There are a number of ace tools to help you generate your perfect htaccess file, below is the one I usually…






Include PHP variables into jQuery

Posted on 25th September, 2013 1 Comment

There is a simple answer to this problem… To use PHP in jQuery you just need to add the jQuery to a .php document. I’m using the Cycle.js slider plugin in my 3x examples below. Which is plucked from this article Responsive Custom Post Type Slider If you would like to add an options page,…






Add php to the text widget

Posted on 11th September, 2013 Leave a Comment

This is a real beaut of a snippet and deservedly belongs a place in the “Must Have Snippets” hall of fame. Basically all this does it allow you to add and then process php inside the text widget, which means that you won’t need to use a plugin! Add this to your functions.php: Then when…






Include jQuery into your theme through the functions.php

Posted on 21st August, 2013 Leave a Comment

Over time I’ve realized that there is a better way to include jQuery. Rather than adding your jQuery straight into the header.php or footer.php of your theme files which can be untidy, I would recommend adding a function to your function.php which is a lot neater. So open the functions.php scroll to the bottom and…






WordPress Security with the .htaccess file

Posted on 14th July, 2013 4 Comments

So I showed you how you can help speed up WordPress using a single line of php in your header.php theme file and by adding a few simple lines to your htaccess file. Now lets concentrate on security. As WordPress is now so widely used (60+ Million users) it has become a bit of a…






Speed up WordPress

Posted on 13th July, 2013 Leave a Comment

This is something that I add to all my sites, it will increase the load time. Check your site now on http://gtmetrix.com/. < This site gives you a breakdown of your sites performance and will show you the areas that you need to improve on. This page is dedicated to improving your sites performance, which in…