WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp_list_categories without BR (5 posts)

  1. SteCampbell
    Member
    Posted 5 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?

    Thanks.

  2. esmi
    Forum Moderator
    Posted 5 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
    Member
    Posted 5 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
    Member
    Posted 5 years ago #

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

    I know how to get rid of

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

  • Mark / t31os
    Moderator
    Posted 5 years ago #

    Use this instead...

    <?php
    	$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

    Tags