Useful WordPress Tricks to Make Your Theme Even Better

By | 10/01/2010

WordPress is a very powerful CMS (Content Management System). It has tons of capability and can be extremely powerful. There’s only one thing in the way from all of this power and you as the blog owner – your theme. Here are only a few of the many great snippets of code that will take your current theme creation and make it that much better. Please, use them.

Tip 1- How to Disable Commenting on Posts Older Than 1 Month

A great way to reduce the amount of spam you receive is to disable the ability to comment on posts that are more than 1 month old. Just paste the following in your functions.php file. Note: To change the amount of time from 1 month, just replace 30 (days) with any number of days you want.

Tip 2 – How to Add an Automatically Changing Copyright Year in Your Footer

This is a common sight on most sites, something like a “Copyright 2007 – 2009” or something similar in the footer. Thing is, it’s been more than a month since the new year and yet I’m still seeing “2008” as the current year on some sites. This is how you can:

Tip 3 – How to Disable Search Engine Indexing on a Certain Category

This code snippet is more for SEO purposes, possibly to avoid duplicate content or something similar. Make sure search engines don’t index any posts in a certain category by applying this to your head tags in header.php. Note – Change the category number of 4 to the category you want to prevent search engines from seeing.


Tip 4 – How to Add a Simple “Tweet This” Link to Each Post

Twitter is getting more and more popular each day. To make this benefit you, why not add a nice little “Tweet This” button to each blog post? Put this somewhere in The Loop in single.php.


Leave a Reply