Is there anyway I can strip the link from <?php the_category(',' ); ?>?
Is there anyway I can strip the link from <?php the_category(',' ); ?>?
<?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?
This topic has been closed to new replies.