Call us on 01280 821000
AddThis Feed Button
Register to receive our latest articles by email:


Delivered by FeedBurner
Buckingham Design Associates
Anvil House
63 Well Street
Buckingham
Buckinghamshire
MK18 1EN

T: 01280 821000

Download our vCard Download our vCard
 
RSS feed News & Blogs
A brief introduction to theming Wordpress
user icon Posted by rachael on Friday, October 17th, 2008

All Wordpress installations start out the same; what makes them unique is their skin, or ‘theme’. A theme is a set of files (or ‘templates’) which control how your content is pulled from your database and displayed to your visitors. The bare minimum that a theme requires to work is an index.php file and a style.css.

Index.php is the main ‘template’ that Wordpress relies on - there are numerous files that can take importance over this file, but in the absence of extra files, Wordpress will default back to the main index.php to display your site.

Style.css contains the basic information about your theme (name, author, version, etc.) but also contains all the CSS for your theme as well.

If you’re familiar with CSS already, creating your theme’s stylesheet will be a fairly straightforward process. What will be slightly trickier is the index.php file, as this doesn’t just contain HTML - it needs to be told where and which information to pull from your database, and this happens via the use of ‘template tags’. The best place to learn about template tags is the Wordpress codex.

Unless your site has a minimal amount of content or your theme is very basic, you’ll find that you’ll soon have more requirements than index.php can cope with. If you want certain content to only be displayed on certain pages, or if you want your posts to look different to your pages, etc., then for the sake of file size and readability, it will be a good idea to start adding extra files to your themes.

Common files are as follows:

  • header.php; this contains everything found at the ‘top’ of each page, such as navigation, title, etc.
  • footer.php; this contains everything found at the ‘bottom’ of each page, such as the copyright statement, etc/
  • sidebar.php; your sidebar can contain anything and everything from your archives to your wishlist.
  • single.php; this controls how individual blog entries are displayed.
  • page.php; this controls how your pages are displayed.
  • comments.php; this is perhaps the most common file after header.php, footer.php, and sidebar.php. It controls how comments on your blog are displayed.

Wordpress is an extremely versatile CMS, in that once you have the basic index.php and style.css sorted, your options are then pretty much limitless. Your Wordpress theme can be as simple or as complicated as you want to make it.

Further reading

Related Articles

You can leave a response, or trackback from your own site.

Leave a Reply

Buckingham Design Associates Limited / Registered in England No. 2721714  /  Registered Office: 1 Osier Way, Buckingham MK18 1TB  /  VAT Registration Number: 824 9878 75