WordPress.org

Support

Support » How-To and Troubleshooting » List children categories of a post

List children categories of a post

  • I want to know a way to include a list of children categories for a post. I’ve found this code

    <?php foreach((get_the_category()) as $cat) {
    if ($cat->category_parent == "180") {
    echo '< a >category_nicename . '">' . $cat->cat_name . '</ a >';
    }
    }
    ?>

    But I want to put a separator between each one and not after of before all the categories listed. And a way to put something specific before the last categorie listed will be good, also.

  • The topic ‘List children categories of a post’ is closed to new replies.