• Hi,

    I noticed on a WP-built site that a designer has Categories listed in the sidebar and the HTML output is:

    <div id="left">
    	  		<h2>categories</h2>
    
    			<ul class="bloglist">
    
    			<li><a href="?catId=2">branding</a></li>
    
    			<li><a href="?catId=6">coursework</a></li>
    
    			<li><a href="?catId=1">websites</a></li>
    
    			</ul>
    
    </div>

    Very clean.

    However, when I use the WP code <?php wp_list_categories('title_li=<h3>' . __('CATEGORIES') . '</h3>' ); ?> my code comes out ugly like this:

    <li class="categories"><h3>Categories</h3><ul>	<li class="cat-item cat-item-1"><a href="/blog/la-vie/" title="View all posts filed under La Vie">La Vie</a>
    </li>
    	<li class="cat-item cat-item-4"><a href="/blog/musique/" title="View all posts filed under Musique">Musique</a>
    </li>
    	<li class="cat-item cat-item-7"><a href="/blog/web/" title="View all posts filed under Web">Web</a>
    </li>
    	<li class="cat-item cat-item-6"><a href="/blog/youtube/" title="View all posts filed under You Tube">You Tube</a>
    </li>
    
    </ul></li>

    Why is this?

    What is this other guy doing that I have not done?

    Many thanks for any suggestions.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter sincewelastspoke

    (@sincewelastspoke)

    Can anyone assist?

    ?catId=2
    doesn’t look like a WP code…
    Even if not using the “nice” permalinks, the url created by WP should be
    ?cat=2

    And the code you have is not really “ugly” – it has all the necessary classes to highlight current category (for example) and/or do other CSS tricks.

    Are you sure that this site is built by WordPress as like moshu says that doesn’t seem to be WP code at all. I have never seen it before anyway.

    Thread Starter sincewelastspoke

    (@sincewelastspoke)

    Apologies. I’ve now found the solution.

    If you did… then be nice and explain it for future searchers.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Customise wp_list_categories()’ is closed to new replies.