People (visitors) quite often enquire why there is a lack of detail in the various code snippets given as brief tutorials on this blog. And it’s true, often only the only relevant line of code is given.
Well, simple answer - I am a great believer in the principle:
If you have ask - you probably shouldn’t be doing…
read more »
Keep it simple - KIS - is fairly obviously good advice for any WordPress theme builder.
Keep it universal - there are a lot of people out there, running all kinds of different system, doing different and strange things with the files, any complexity is increasing the risk of breaking the theme for them…
read more »
It is possible to switch a theme’s CSS, depending on whether widgets are enabled or not - whether, like a lot of things in programming it is a good idea to do this, just because you can, is another matter…
read more »
You will need a little knowledge of PHP and MySQL to get the hang of this - but it is perhaps easier than it looks at first sight, and it’s also a good way of expanding your skills in this area…
You want to get some info from the database, and you want it more flexibly than built-in functions like, say, wp_list_pages - this is the general how-to …
read more »
This tutorial adds a button to the Wordpress post/page editor in code view, to add a link to a podcast file in your post and therefore also your RSS feed - so that you should end up with this:-

read more »
I’m that ancient that I’m not quite sure web pages should have images on them, but if you do want to try this new-fangled (in 2005) podcasting business, it’s pretty simple with WordPress.
Strictly, what a podcast is not is a link to a media file from a web page. Yes, large media websites, eg bbc.co.uk think that’s exactly what it is, but what do they know…
read more »
Here’s a nice and neat code snippet - making use of the template and conditional tags to output unordered list items for all child pages under the current page - with links - and just the thing to stick in a theme’s sidebar.
Best used in conjunction with is_page, of course, so…
<?php
if(is_page()){
$parent = ($post->post_parent == 0)? $post->ID : $post->post_parent;
wp_list_pages(’child_of=’.$parent.’&title_li=’);
}
?>
As requested, the code for page menu tabs - leaving open the possibility of using the ’sliding doors’ technique - put it in a theme’s functions.php, and the usage, if not too obvious, would be something like…
<ul id=”tabmenu”>
<?php echo buildMenu(); ?>
</ul>
read more »
You want to put an advert (or anything else) after some posts on the front page, but not others.
There are some fancy programming ways of doing this involving template tags, but this way will do just fine and couldn’t be simpler.
First, find the Loop in your index.php
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
… the post …
<?php endwhile; ?>
read more »
You want to list your pages as fixed links, for example in the header of the theme, rather than simply use the sidebar lists, with widgets or otherwise. In WordPress, this is handled by the wp_list_pages() function.
read more »