29th August 2008 - 6 minutes read time
If you want to display a Wordpress front page in a new or interesting way by splitting the categories into sections, or by not displaying certain categories at all then you can use the query_posts() function. This function comes as part of Wordpress and allows you to override the queries that are being executed behind the scenes. This basically controls what posts are seen by "the loop". In order for the function to work it must be called before "the loop", look out for this line (or similar):
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
And put the call to query_posts() before that. You will need to give it certain parameters in order to do something.
So what can you do with this function? Well all sorts of stuff, but for this post we are just interested in getting different categories out, so lets concentrate on that.