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?

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

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

echo wp_list_categories(array('title_li' => false, 'style' => false, 'separator' => ''));
  • if I keep it blank then there won't be any <br> right? – Mahmud Farooque Jul 23 '18 at 14:30
  • yes it will remove <br> tag – Bhupen Jul 24 '18 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, privacy policy and cookie policy

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