Support » Themes and Templates » Category list title repeated

  • Resolved gilliancs


    I’ve updated from 2.04 to 2.3 and now find that the title “category” is repeated in my sidebar. I’ve looked at the pages about list_category tags to see if the syntax is changed but can’t work out what the problem is. I’m using the Sandbox K2light theme (somewhat hacked about).

    I’d be very grateful for any help: I know it must be a busy time for everyone.

    <?php /* if this is not a page */ if ( !is_page() )
    				{ ?>
    		<li class="category-links">
    			<h3><?php _e('Category', 'sandbox'); ?></h3>
    		              <?php wp_list_categories('sort_column=name&hierarchical=true&hide_empty=false') ?>
    				<?php } ?>
Viewing 5 replies - 1 through 5 (of 5 total)
  • Yeah, you can lose the H3 tags there… but if you want to use H3 instead of the default H2 for the title, you’ll have to do this:


    Thanks for your reply. The problem is that I get a list like this:

    Category 1
    Category 2
    Category 3 . . .

    I don’t know where ‘Categories’ is coming from. (It’s in a different style from both the Category heading-h3-and the list of categories.)

    It looks as if wp_list_categories is now returning the title of the table as well as the contents.

    it’s default output from wp_list_categories

    do like I said, and get rid of your H3 heading there, and use:


    it’s the new “improved” way 😉

    Brilliant! Thank you very much.

    I see I needed to put the title call and the list call all in one, instead of separating them.

    And as I understand it, the title ‘Categories’ is output by default, unless you define a different title, or none by using ‘ ‘.

    The final code was:

    <?php if ( !is_page() )
          { ?>
    	<li class="category-links">
    	  <?php wp_list_categories('title_li=<h3>Category</h3>&sort_column=name&hierarchical=true&hide_empty=false'); ?>
    	<?php } ?>

    What’s the best place to find an up-to-date list of tags and parameters for 2.3?

    Most welcome.

    Yes, the Categories output is the default where no title is specified.

    You can dig these things up in the codex

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Category list title repeated’ is closed to new replies.