Currently Browsing Recent Articles

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…

Create a better options page with the theme customizer

Posted on 4th March, 2014 5 Comments

Since WordPress version 3.4, there has been a rather underused theme customizer, which allows the end user to view any changes made to the theme in a window next to the customizer! Now that’s super cool. You can grab this options.php page from the WPtricks starter theme on GitHub, along with a contact page template,…

carousel style post navigation with Parallax

Posted on 7th February, 2014 1 Comment

Recently I noticed the BBC’s really super sweet category navigation, in the form of a slider that is the full screen width, that shows the current categories articles, with the next and previous article being displayed behind an opaque overlay. Looks awesome right? Well I thought so, and this tickled my developer funny-bone and inspired…

Add an options page to WordPress

Posted on 19th October, 2013 3 Comments

This post is a little out of date – Read below The framework is no longer available as an open source project and is now a premium framework! But I’ve created another options page using only the theme customizer which is pretty awesome. It allows you to view the changes to your theme as you…

How to build a dynamic sitemap for wordpress

Posted on 14th October, 2013 Leave a Comment

I always like to include a built in sitemap page to my themes (without using a plugin). So thought I’d include this quick tut on how this is achieved. Also to give the end user some control over whether this should be displayed, I’m including this as a template, for use with WP pages. This…

The complete guide to customising the default post _type

Posted on 1st October, 2013 Leave a Comment

Sometimes rather than creating a custom post type with custom taxonomies, we can just edit the default Posts section in WordPress. With that in mind I thought that I’d create a complete “snippets” guide on how to edit the default WordPress post_type “Posts”.  In this example I’m renaming the “Posts” to “Developments”. Quick Menu: Rename…

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,…

Create a built in contact page for WordPress

Posted on 21st September, 2013 2 Comments

I do this for every theme I create and figured most of you would use a plugin, which is not really necessary. WordPress has mail functionality already so all we’re going to need to do is leverage that and add some style in the CSS. Uses the administrators email address Adds your site title to…

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…