WordPress.org

Support

Support » Themes and Templates » [Resolved] How to Add a Comma Using wp_list_categories?

[Resolved] How to Add a Comma Using wp_list_categories?

  • I’m wanting to have a comma display after each child category. I’m currently using <?php wp_list_categories(‘child_of=6&orderby=name&title_li=’); ?>

    Which displays Cat 1 Cat 2

    But I want Cat 1, Cat 2

    How can I go about doing this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Use <?php the_category(‘, ‘) ?> instead of wp_list_categories()

    That gave me the comma but it doesn’t sort the categories by the child id which I need.

    If someone could tell me which file calls out the function wp_list_categories I could go into that file and just put a comma after the because wp_list_categories does excactly what I want, it’s just missing a comma.

    wp_list_categories is defined at line 209 in /wp-includes/category-template.php

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] How to Add a Comma Using wp_list_categories?’ is closed to new replies.
Skip to toolbar