Ready to get started?Download WordPress


How to strip all formatting from wp_get_categories(), including trailng <br> (2 posts)

  1. gendem
    Posted 5 years ago #

    Title says it all. I currently use


    which gives me the category list as a link (perfect) but each one is followed by a BR, which I do not want.

    How do I format the call so that each category is returned as link with a single space between each one?

    In other words, instead of this

    <a ...>Cat 1</a><br />
    <a ...>Cat 2</a><br />

    I get this

    <a ...>Cat 1</a> <a ...>Cat 2</a>


  2. gendem
    Posted 5 years ago #

    To answer my opwn question, do it like this:

    <?php echo str_replace('<br />',' ', wp_list_categories('echo=0&style=&title_li='));?>


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.