By default WordPress presents all the posts in the blog sorted descending to post time at the home page. Well in some circumstances you might not want to have that layout on your home page. Lets say you have five categories and you want to pull the latest post from each of the categories and display it on your home page. Now that wont work out with the default WordPress home page layout. Here is a simple tip to work around that situation. WordPress has a function to filter out the posts depending on certain criteria, the function is known as query_post. The template function query_post has several parameters that enables you to filter the posts for the WordPress post output Loop. Below is an example of pulling the latest post from a category and display it at the blog home page. The query_post function can be modified by many parameters. Here I’m displaying only few parameters in action.
Don’t you come across situations like you need to implement multiple header types for different categories? I’m sure you do. Here is a simple yet effective solution to work out the issue to implement multiple header types for different categories. For more conditional tags you can look up to WordPress codex.
First of all create the header files for each categories. Also have one header file as the default one. These files will be included from the main header.php file. Consider the code below for the your WordPress theme header.php file.