Written by Sarah from Stuff By Sarah on May 11, 2008

These days sidebars get so easily cluttered with recent posts, categories and tags, recent comments, top commentators etc. The list is endless. Throw in your blogroll and your sidebar can become longer than the page content!

Moving your blogroll into its own page can keep things neater and allow you to have a longer list that doesn’t clutter up your sidebar. The way to do this is with a page template.

Creating a Page Template

Your theme may or may not have a page.php file already in it. If it does then open…

Written by Sarah from Stuff By Sarah on May 4, 2008

When new visitors come to your site via an internal page they won’t see the most recent posts you’ve written without having to go to the front page. If there’s nothing to entice them further into the site then they’ll leave just as quick as they came. So you want to put your latest posts in their face pretty much!

In WordPress this is easily done using the get_posts() template tag. The basic usage of this tag is

< ?php
$myposts = get_posts();
foreach ($myposts as $post) :
     echo "<li><a href='".the_permalink()."'>".the_title()."</a>\n";
endforeach;
?>…
Written by Sarah from Stuff By Sarah on April 27, 2008

At first, most bloggers don’t consider the need for a static page. Maybe one that has some about details on, but nothing more. As time goes on they may add one or two more pages, then a couple more. If they’ve stuck with the same theme then they’re most likely manually coding in the page links into their site, or they come manually coded in the case of some of the free themes available. Good idea? Well not necessarily, not if you intend to maybe change the page slug, or…

Written by Sarah from Stuff By Sarah on April 20, 2008

Template tags are functions defined in the core WordPress files and are globally available for use in your templates. There are a lot of tags available for different aspects of your template files. To get a complete list of what’s available see the Template Tags on the WordPress Codex.

Some accept many parameters (information passed to the function enclosed in the brackets/parentheses), others do not accept any parameters. To use a template tag you need to ensure it’s within opening and closing PHP tags e.g.

<?php template_tag_name('parameter_name=value&parameter2=value'); ?>

If the tag is going into…

Written by Sarah from Stuff By Sarah on April 13, 2008

Quick Introduction - I’m Sarah and I will be writing each Sunday on intermediate to advanced WordPress topics including template development, tips and tricks, PHP coding for use in WordPress and plugin development. I’ll be basing my posts on the latest version of WordPress, and also assume an understanding of HTML and CSS, and presume you don’t run at the sight of a little PHP ;) I’d love to hear what you want to read about on this subject so please let me know in the comments.

Understanding the WordPress Template Hierarchy

At…