Currently Browsing The Snippets Category

Change template_directory to use a CDN path

Posted on 16th September, 2015 152 Comments

So you’ve created your theme and you would like to switch to using a CDN for your scripts and CSS… Add this to your functions.php and replace the YOUR-SITE with the urls of the website and the CDN.

Moving the menu items in WP Admin

Posted on 29th January, 2015 867 Comments

This was a snippet I grabbed off of tutsplus! I’ve found this super useful when I’ve been creating customer themes to give a menu item a higher priority in regards to it’s use in the theme. functions.php

Next and Previous Posts Navigation With Thumbnails.

Posted on 31st May, 2014 5,669 Comments

A nice way of adding next and previous post navigation with thumbnails and a short excerpt. I’ve created a file that you can just add into your theme folder and call in your actual theme with this include snip; If you want to download my file then click here, otherwise you can copy and paste…

Adding Breadcrumbs without a plugin

Posted on 26th May, 2014 2,734 Comments

So there are plenty of plugins available if you just want to add breadcrumbs to your theme, but if you want something a little lighter then you could just add this to the theme functions.php. This adds a simple breadcrumb to your theme. THIS HAS BEEN RECENTLY UPDATED, I WISH I COULD REMEMBER THE ORIGINAL…

Custom excerpt length & Read More link WordPress

Posted on 26th May, 2014 671 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 354 Comments

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…