Tag Archives: Categories

Custom Category Templates on a Archive or Index page.

April 23, 2008 by aaron
On my home page and in my archives, I use a custom category template to display asides and news articles. This is very easy to do and it only takes a couple seconds of work to create custom category templates in any WordPress theme. The first step is to add the following to your current theme’s index.php loop after the line that looks like <?php while (have_posts()) : the_post(); ?>, but before any other code.
Read More ⟶

Displaying WordPress categories in a horizontal dropdown menu.

April 16, 2008 by aaron
One of my readers recently asked how I created my horizontal menu bar: the short answer is by mixing CSS and Javascript. The first step is to get WordPress to display the menu as a hierarchical list without a title. <?php wp_list_categories('sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0'); ?> We then wrap this WordPress code in the following so we can style it. <div style="text-align:center;"> <ul id="menu" style="padding:0; margin:0;"> <?php wp_list_categories(&#039;sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0&#039;); ?> </ul> </div> I added this to my header.php, but you can add it anywhere you want it to appear.
Read More ⟶

Custom Category Templates on a Archive or Index page.

April 23, 2008 by aaron
On my home page and in my archives, I use a custom category template to display asides and news articles. This is very easy to do and it only takes a couple seconds of work to create custom category templates in any WordPress theme. The first step is to add the following to your current theme’s index.php loop after the line that looks like <?php while (have_posts()) : the_post(); ?>, but before any other code.
Read More ⟶

Displaying WordPress categories in a horizontal dropdown menu.

April 16, 2008 by aaron
One of my readers recently asked how I created my horizontal menu bar: the short answer is by mixing CSS and Javascript. The first step is to get WordPress to display the menu as a hierarchical list without a title. <?php wp_list_categories('sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0'); ?> We then wrap this WordPress code in the following so we can style it. <div style="text-align:center;"> <ul id="menu" style="padding:0; margin:0;"> <?php wp_list_categories(&#039;sort_column=name&sort_order=asc&style=list&children=true&hierarchical=true&title_li=0&#039;); ?> </ul> </div> I added this to my header.php, but you can add it anywhere you want it to appear.
Read More ⟶