WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. gendem
    Member
    Posted 4 years ago #

    Title says it all. I currently use

    wp_list_categories('title_li=&style=none');

    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>

    ...Mike

  2. gendem
    Member
    Posted 4 years ago #

    To answer my opwn question, do it like this:

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

    ...Mike

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.