1

used this code and that did not worked for me.

echo str_replace( "<br>", "", wp_list_categories(array('title_li' => false, 'style' => false)));

what did I missed?

1
  • Please use the tools to format your text and code, and explain your problem not only in title. :)
    – Elex
    Commented Jul 23, 2018 at 12:45

2 Answers 2

0

You can replace '<br>' with '' by setting separator value

echo wp_list_categories(array('title_li' => false, 'style' => false, 'separator' => ''));
2
  • if I keep it blank then there won't be any <br> right? Commented Jul 23, 2018 at 14:30
  • yes it will remove <br> tag
    – Bhupen
    Commented Jul 24, 2018 at 6:57
1
Please use below code it will help you
 $args = [
    'style'     => 'none',
    'separator' => '', // <-- Removes the default one
];

wp_list_categories( $args );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.