beans_etc
Member
Posted 3 years ago #
I'd like to display simply the name of the category a post belongs to underneath the post title. But when I use <?php the_category(); ?> it automatically makes the name a link. Is there anyway to get rid of the <a href" it puts in so it displays as just text?
Check out the Category Template Tags.
Template_Tags/#Category_tags
beans_etc
Member
Posted 3 years ago #
I did. There's a similar one "single_cat_title", but it only seems to work if you're on the single page for the category itself. I need it to be able to display the name of the post category, not the current page category.
I said check them ALL, not what you think it should be.
Template_Tags/get_the_category
And don't ever double post, unless yu want your topics deleted!
beans_etc
Member
Posted 3 years ago #
I thought that one was only used for backend purposes because it says "This function does not display anything". I'm not very php savvy, so I assumed that meant it couldn't be used to show text.
I'll try this to see if it works, thanks~
beans_etc
Member
Posted 3 years ago #
(Apologies for the double post.)
Don't think, just read:
The following example displays the category name of each category assigned to the post (this is like using the_category(), but without linking each category to the category view, and using spaces instead of commas):
beans_etc
Member
Posted 3 years ago #
Nice, I just put it the first example from that page as is and it worked! Thanks a lot for the help and clarification~