The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] wp_list_categories without BR (5 posts)

  1. SteCampbell
    Posted 7 years ago #

    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?


  2. esmi
    Forum Moderator
    Posted 7 years ago #

    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.

  3. SteCampbell
    Posted 7 years ago #

    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.

  4. not2bug
    Posted 7 years ago #

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

    I know how to get rid of

  5. but what about

    $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.

  • Mark / t31os

    Posted 7 years ago #

    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)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic