Support » Fixing WordPress » Get multiple category names inside the loop

  • Resolved applegateian

    (@applegateian)


    I need to be able to get all the category names within a post in the loop.

    I have checked out WordPress get_the_category on this, and the example Show the First Category Name Only
    works how I want, but only shows One category:

    <?php
    $category = get_the_category();
    echo $category[0]->cat_name;
    ?>

    How do I get all of them?

    Thanks,

    Ian

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get multiple category names inside the loop’ is closed to new replies.