Support » Themes and Templates » Styling the Categories list

  • Hi

    I’m wondering how to style the list of categories when you call them, ie rather than the list be outputted as ‘Category One (17)’, I’d like it to say ‘Category One……….17 entries’ etc.

    Would appreciate any help.


Viewing 1 replies (of 1 total)
  • at the example of the default theme:

    hardcoded category list in sidebar:

    $variable = wp_list_categories('echo=0&depth=1&show_count=1&title_li=<h2>Categories</h2>');
    $variable = str_replace('(1)', '<span>1 entry</span>', $variable);
    $variable = str_replace('(', '<span>', $variable);
    $variable = str_replace(')', ' entries</span>', $variable);
    echo $variable;

    (this is a variation of:

    style.css for it:

    .categories .cat-item { border-bottom: 1px dotted #06c;
    	position:relative; }
    .categories .cat-item a { height:20px;
    	position:absolute; left: 0px; top:4px;
    		background:#ffc;padding-right:8px; }
    .categories .cat-item span { height:20px;
    	position:absolute; right: 0px; top:4px;
    	padding-left:8px; color:#06c; font-size:9px; }
    .categories ul.children {display:none; }


Viewing 1 replies (of 1 total)
  • The topic ‘Styling the Categories list’ is closed to new replies.