Display Subcategories Before Post Title (like “Category Subcategory Post Name”)
-
I have a post that is nested in a subcategory like:
Cars->BMW->Latest BMW ModelsI want to display the parent categories of a post in their corresponding order as the title of the post.
E.g: instead of showing just “Latest BMW Models” I want the post title to say “Cars BMW Latest BMW Models”. I know this makes no sense to you but I am giving the car blog just as an example, my blog is about completely different thing.
Also, it should work no matter how deep the post is located, e.g Cars->BMW->Sedan->Diesel->2010 models->Latest BMW Models.
So is there a WordPress function to just list the Parent categories of a post in the correct order or at lest pass them to an array? I am pretty knowledgeable at PHP so you can skip the basic stuff like “go to this line”, “replace this line with this”. Just point me a function that may help.
Thanks in advance for the help and regards!
- The topic ‘Display Subcategories Before Post Title (like “Category Subcategory Post Name”)’ is closed to new replies.