WordPress.org

Forums

[resolved] How to Add a Comma Using wp_list_categories? (5 posts)

  1. scottbotkins
    Member
    Posted 7 years ago #

    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!

  2. pramodd
    Member
    Posted 7 years ago #

    Use <?php the_category(', ') ?> instead of wp_list_categories()

  3. scottbotkins
    Member
    Posted 7 years ago #

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

  4. scottbotkins
    Member
    Posted 7 years ago #

    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.

  5. pramodd
    Member
    Posted 7 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic