Support » Fixing WordPress » <?php the_category(‘,’ ); ?> without link?

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php
    foreach((get_the_category()) as $category) {
        echo $category->cat_name . ' ';
    }
    ?>

    Discussed here. Does that work for you?

    worked perfectly! thanks!

    hi there, i searched for the same thing and this worked for me too… but am i able to show the category in which the post is only? without the parent category…

    This works great for stripping the link, but a cool feature in the_category() is being able to use a separating character that doesn’t echo on the last cat. Is there a workaround to make get_the_category() work like this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘<?php the_category(‘,’ ); ?> without link?’ is closed to new replies.