Feb
How To Create A WordPress Theme - Part 7
by admin
This is the seventh part of how to create a WordPress theme. In the last part How To Create A WordPress Theme - Part 6, you added a couple of pages and cleaned up the sidebar and footer areas with some plugins. In this part you will add some more useful plugins.
WordPress is a powerful CMS (Content Management System) but there are some things it cannot do or do easily. To overcome this you can use plugins and/or widgets. We have already looked at the Recent Comments and Popularity Contest plugins, now we shall have a look at some more.
Plugins For Pages
So far we have the About and Archives Pages, but there are others you can have to organize things better.
Site Map
There are two kinds of Site Map, one for people and one for the Search Engines. The one for people is handy to have, your visitors will have direct links to your Internal Pages, Posts (with or without the number of comments for each one), Monthly Archives, Categories and all RSS Feeds. This also helps your SEO efforts because you are providing internal links to all your pages/posts.
The one I use is from Dagon Design. It is very flexible in how it outputs the information. Be sure to print out the installation and usage instructions as the archive does not come with a readme.
You should also have a site map for the Search Engines. The ;Google XML Sitemaps will update itself each time you post and notify all the major Search Engines.
Contact Page
I don’t care who you are or what you blog about, you are in it for profit of some kind, it could be financial, ego-stroking or whatever. Your visitors are your potential customers and they will want to contact you at some point. If you have a popular blog then advertisers may want to contact you. If you want to be successful you must network with others and that demands mutual contact.
Having your email address on a page is one way, but the spammers will harvest it and deluge you with spam - bad idea! Instead, you should have some kind of spam-protected contact form. There are a multitude of these available, my personal favorite is Mike Cherim’s Contact Form v.2.0WP. It is an easy and secure method for your visitors to contact you.
If you want more of a support desk type thing then I highly recommend DanPHPSupport, it’s free, xhtml compliant and easily molded to whatever layout you have. It’s a good support ticket system. When you install it set it up in it’s own folder in the site’s root directory.
Sidebar Plugins
To increase comments you can use the Show Top Commentators. People are always competitive and this could be further encouraged by running a competition tied into comment count or giving back-links to the top three at he end of each month.
To add it to the sidebar use the following code:
<?php if(function_exists('ns_show_top_commentators')) : ?>
<li><p class="sbheader">Top Commentators</p>
<ul><?php ns_show_top_commentators(); ?></ul>
</li>
<?php endif; ?>
Content Plugins
If you are using tags, the use of Related Posts can help keep visitors at your site by showing them other posts that are related to the one they are viewing.
I don’t know about you, but when I make a comment on a post I like to see what, if any, reaction there is to it. With this plugin, Subscribe to Comments 2.1, I can follow the conversation without bookmarking or trying to remember where I commented.
The WP-PageNavi 2.20 plugin is very useful for anything that is multi-page such as the index, archives, categories, tags etc.
SEO Plugins
There are only two that I would recommend, the first is the All in One SEO Pack. It will:
Format your page titles.
Look after the meta tags keywords and descriptions
Can add noindex to the archives, categories, tags pages.
To me this plugin is not optional, you should use it on any WordPress blog that you have.
The second plugin is Enforce www. Preference. Most hosts allow you to access your site by either www.name.com or just name.com. Google will rank both forms as separate pages thus diluting your PR. This plugin will force one or the other to allow maximum rank for each page.
Behind The Scenes Plugins
Comment spam is a problem, WordPress comes with Akismet which I have found to be sufficient. It has been updated recently so I would advise that you upgrade.
Some sites, like Sitehoppin, will attempt to show your site inside a frame. You can prevent this by using Break-Out-Of-Frames WordPress Plugin.
FeedBurner FeedSmith redirects all possible ways to access your feeds and then redirects them all to your FeedBurner feed so that you can track all subscribers.
Theme Usability
Many of the plugins or themes require you to add some code to your theme, generally to call a function:
<?php somefunction(); ?>
This is fine if the theme is for your own use, but what if you are planning on distributing your theme? You should check that the plugin is present as follows:
<?php if(function_exists('somefunction')) : ?>
<?php somefunction(); ?>
<?php endif; ?>
This way you can advertise that your theme is compatible and setup for such and such a plugin, all it requires is that the user download and install the plugin - no theme mod required. I use this method even if the theme is for my own use because it allows me to deactivate a plugin without breaking a theme.
Wrap Up
This is a fairly minimal set of plugins, I don’t like loading up a theme with all kinds of stuff, no matter how appealing they are as each one will slow down the loading of your page. There are other plugins you can use, a good place to start your search is at the main WordPress site.
We have almost come to the end of this series on how to create a WordPress theme. Next time, I shall show you how to have different sidebars and headers for different pages.





Colin,
I really great series that you are writing here. Trying to catch up and having a few mishaps on the way lol, somethings seem to ‘break’ when I touch them!
Think it would be good, that when you come to the end of the series you put the posts (and a bit extra stuff) into an ebook for people to further reference from?
Just a thought.
So I thinking just yesterday, “I should figure out how to set up a sitemap for FiveBlondes”. Today, here I am, and you have answered exactly what I was wondering. Again.
Forget Google. Next time I’m searching for something I’ll just come here first!
@Nick: I mentioned a possible “ebook” in a previous comment. I’m still thinking about this… like what to add and how to distribute etc.
@Erica: LOL
[…] is the seventh part of how to create a WordPress theme. In the last part How To Create A WordPress Theme - Part 7, we covered some useful plugins that can enhance the usability of your […]