WordPress: Adding Categories at the Page bottom (footer)

Using WordPress and filled all the spaces in sidebar and navigation with multiple widgets or text content, And finding no space for Categories! No worries, you have another place to add your blog categories. Add all categories at the bottom of the web site.

Generally categories become so many in numbers that you cannot add all of those in top navigation bar. and many times it is too broad to add much significance to your visitors. Tag are more specific to each post and you may want to display your visitors, so you have decided to add those in sidebar or other prominent places.

If you have tried to give Categories a good name then this can also be useful for your blog visitors. and after all you have given your time to it so why not display somewhere on blog. So, lets add categories at the bottom of each page and curious visitors will get it.

Here is the function for generating categories list:

if (! function_exists('catList')) {
	function catList() {
		$args = array(
		'orderby'            => 'name',
		'order'              => 'ASC',
		'show_last_update'   => 0,
		'style'              => 'none',
		'show_count'         => 1,
		'hide_empty'         => 1,
		'use_desc_for_title' => 1,
		'child_of'           => 0,
		'current_category'   => 0,
		'hierarchical'       => true,
		'number'             => NULL,
		'echo'               => 1,
		'depth'              => 1
		);
		wp_list_categories( $args );
	}
}

I am using Wordperss function wp_list_categories().

The above code when called in this way:

<b>Categories</b>:<br />
 <?php catList(); ;?>

will generate output like this:

wp-categories

The HTML inside the above output is:

<Category link/>
<br/>
<Category link/>
<br/>

If you want to hide count (number of post inside each categories), then set show_count = 0. Then the output will similar to this:

wp-category-2

Note: Your CSS can affect the look of the output. Here only two HTML tags are coming - <a> and <br>, so CSS related to these two on your blog/site can affect the output. In my blog, I am not using hierarchy for categories.

Reference:
Template Tags/wp list categories

A tool for those who blog!

  • # 1 - by Dev | Technshare

    can you tell me how to show categories tab in footer like johnchow.com ??
    thanks

  • # 2 - by Dev | Technshare

    can you tell me how to show categories tab in footer like johnchow.com ??
    thanks

  • # 3 - by Satya Prakash

    Use ‘style’ => ‘list’ in $args array.
    Also check with ‘style’ => ”

  • # 4 - by Satya Prakash

    Use ‘style’ => ‘list’ in $args array.
    Also check with ‘style’ => ”

Comments are open for an year period. Please, write here on Facebook page.