Currently Browsing The Code Snippets Tag

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…






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…






Loading jQuery Plugins into Theme Files

Posted on 21st June, 2013 Leave a Comment

My preferred method of adding JavaScript into any theme, is to include a single js sheet called ‘scripts.js‘ then call it in your functions.php. The only real trick here is to load the script inside a function that declares the dollar sign. For this example I’m going to add colorbox to the theme but you…






Removing blank lines between your code

Posted on 17th June, 2013 Leave a Comment

Have you ever taken a file from your server, opened it up and there are a ton of blank lines between all your lovely code? This is one of those really annoying things that you have absolutely no control over, but there is a quick fix, not perfect but it will make your code workable…






Useful WordPress theme snippets

Posted on 7th June, 2013 Leave a Comment

This is an ever growing, evolving list of useful WordPress snippets, created as a reference for theme developers and hobbyists. I suggest you drag this link to your favorites and bookmark this page, then simply copy & paste each snip as it’s needed then add it to your theme file. If you’d like to add…