Support » Themes and Templates » wp_list_categories without BR

  • Resolved SteCampbell


    Im using:
    <?php wp_list_categories('style=none'); ?>

    To output links to all my categories, however its appending a BR element after each category, anyway to stop this?


Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi


    Forum Moderator

    Not without hacking the core, as far as I’m aware. Why do you want to suppress the default list markup? It might be easier (and more accessible) if you simply re-styled the default list using CSS.

    Cheers. I guess I was just trying to make things difficult for myself.

    Now using:

    <?php wp_list_categories('title_li='); ?>

    to suppress the unwanted title LI element and styled the list accordingly.
    Thanks again.

    I have the same problem. And NOTHING is solved here.

    I know how to get rid of

  • but what about
  • <?php
    $cats = wp_list_categories('orderby=name&amp;title_li=0&amp;style=none');
    $cats = strip_tags($cats,"<br /><br />");
    echo $cats;

    i have tryd str_replace and nothing? wtf please help me.

Use this instead…

	$listcats = wp_list_categories('title_li=&amp;style=none&amp;echo=0&amp;orderby=name');
	$listcats = str_replace("<br />","",$listcats);
	echo $listcats;

Be sure to remove the amp; bits from the code… (FORUM STILL ADDING THEM – YES I’M LOOKING AT YOU …AGAIN.. MODS… hehe)

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