Support » Fixing WordPress » Show Category title even when no posts

  • How can I show the category title even when there are no posts.

    If the category has children then I would like to list the children too.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can display sub category using below code

    <?php $this_cat = (get_query_var('cat')) ? get_query_var('cat') : 1; ?>
    <?php $this_category = get_category($this_cat);
    if ( $this_category->parent ) { $this_cat = $this_category->parent; } ?>
    <?php wp_list_categories('child_of=' . $this_cat . ''); ?>

    Where does that code go?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show Category title even when no posts’ is closed to new replies.