A theme consists of many files, this can get very confusing very fast. What files are needed? What files runs when and why? Here are the explanations and tips about WordPress template files.

First things first, what is a template exactly? A template is a PHP file that is a part of a theme. For example, there is a template for displaying the home page, one for displaying pages and another one for displaying posts.

What Are The Existing WordPress Tempaltes?

Here is a list of the existing WordPress templates that can be used in themes:

Here is a very useful image provided by WordPress Codex (click to enlarge):

WordPress Template Hierarchy

Custom Templates

There are two main types of custom WordPress templates.

The first one are templates that WordPress looks for automatically, and if one is found it will be used. What the heck am I talking about?
If you have a category called “News” with the ID of 512 and you want the archive page of that category to have it’s own unique template you can create a new template file called category-512.php in the theme’s folder. And WordPress will use it.

This is the list of custom wordpress templates you can use:

WordPress Custom Template Drop Down

Now for the second type of WordPress custom templates.

Let’s say you have more then one page* you want to be displayed in a different way then the others. How do you do that?
Create a new file called whatever.php at your theme’s folder and inside write whatever you want instead of single.php or index.php (depending what displays the single posts at your theme).
Add this comment to the top of the file:

<?php
/*
Template Name: The Whatever Template Yo
*/
?>

(Of course change The Whatever Template Yo to the new template’s name)

Now edit (or create) the pages which you want to use this template and in the right side pick the desired template from the drop down menu. Just like in the screenshot at the right side.

*If you want to do this for posts rather then pages then you will find the Custom Post Template plugin very useful.

Any questions/corrections? Comments are always welcome.

Search terms:

I hate those small evil graphics

If you want to put an end to those annoying smilies that replace your text in posts & comments, follow the next instructions.

First, what are smilies?

Smileys, also known as “emoticons”, are little faces that help you display various emotions. Text smileys are created by typing two or more punctuation marks like :) and :-(

Here is the full list of smilies in WordPress

icon text text full text icon full text
smile :) :-) :smile: lol :lol:
biggrin :D :-D :grin: redface :oops:
sad :( :-( :sad: cry :cry:
surprised :o :-o :eek: evil :evil:
eek 8O 8-O :shock: twisted :twisted:
confused :? :-? :???: rolleyes :roll:
cool 8) 8-) :cool: exclaim :!:
mad :x :-x :mad: question :?:
razz :P :-P :razz: idea :idea:
neutral :| :-| :neutral: arrow :arrow:
wink ;) ;-) :wink: mrgreen :mrgreen:

How do I get rid of them?

It’s actually pretty easy. All you got to do is go to your admin panel -> Settings -> Writing where you will see the following checkbox:
Convert emoticons like :-) and :-P to graphics on display
Uncheck the check box that says “Convert emoticons like :-) and :-P to graphics on display” just like in the image above and click “Save Changes”.

How to replace them

If you want to keep the smilies but you don’t like the current set of smilies you can change them.
Open your FTP program (I use FlashFXP) and upload (overwrite) your custom smilies to /wp-includes/images/smilies.

Looking for more information? Check out the WordPress codex page on smilies.
What about you, do you like them? I just prefer the plain text, it makes it easier to understand. :P

Search terms:

My No Meta WordPress Plugin finally got his own WordPress dot Org page.
Now I’m waiting for my Mass Custom Fields Manager to get approved.
I always wanted to have my own plugin page :). It just makes me proud to be an owner of an open-source plugin.

Howto get a WordPress plugin page

In order to get a plugin page at WordPress.org (like http://wordpress.org/extend/plugins/plugin-name-here) you need to do a couple of things as described below:

  1. Think about a good idea for a WordPress Plugin.
  2. Develop the plugin yourself / hire a developer to code the plugin for you / contact me and ask me to code the plugin for you.
  3. Register as a member at WordPress.org
  4. Ask WordPress to host your plugin.
  5. Grab yourself some cookies & milk and wait until they send you an email saying they approved your plugin (Usually within one week). If you receive an email saying that they didn’t approve your plugin then… Well I have no idea because I never got one.
  6. The email will say that you will receive access to your SVN within the next hour so this step is just more waiting :(.
  7. Once you got your access, read this tutorial on How to Use Subversion to upload your plugin (=get a plugin page), and upload your plugin files to the /trunk folder. If you encounter any problems with this step like I did (this is the toughest step), contact me through the contact page or by leaving a comment and I’ll get back to you + Update this post with the solution so it helps other people as well.
  8. Wait up to fifteen minutes (WordPress checks for updates every 15 minutes) for WordPress to create your plugin page and then use the WordPress plugin search to find it.
  9. Be pround of yourself and comment here to let me & other people know that this tutorial works.

Frequently Asked Questions

I hope this guide will help some people to get started with WordPress plugin developing, because it’s just amazing what you can do with it. The way that WordPress was built lets you change virtually anything and tweak the system in any way you want.

Search terms: