Skill: Moderate
Estimated Time to Complete: 5 Minutes
If you are trying to call the category name in WordPress by the tag the_category( ‘, ‘ ); a link is automatically created to the
Using the above code you’ll get only the Category Name.Category Archive page. If you would like to call only the category name without linking the Category archives page to it.
For Example: If you want to show a Subscribe box which says, “Send me newsletters related to ‘WordPress‘ “. Using the default WordPress Category tag will link it to the Category Archive Page.
Use the code below for calling only the Category name:
[php]
<?php
$category = get_the_category();
echo $category[0]->cat_name;
?>
[/php]
After using the above code result should look like this: “Send me Newsletters related to ‘WordPress’”
MNB Achari August 7, 2012 at 6:28 am
edit
wonderful tip! Simple and Easy! Thanks for posting.