By WordPress standards, ANY category that has been designated a Parent category is not meant to be checked in the category hierarchy when writing posts. Meaning, only the latest generation category should be checked. Think of it like this, only the youngest generation gets the action.
It’s okay to have multiple categories assigned a post, as long as the other categories are not designated as parents.
Thread Starter
Alkorr
(@alkorr)
Thanks for your reply MichaelH, now I know 🙂
But this leads to another question: if I check multiple hierarchical categories i.e:
Books + Reviews + Fantasy
Then when I use <?php the_category(‘, ‘) ?>, I get this:
Reviews, Books, Fantasy
Which doesn’t ‘mean’ anything because it’s not hierarchical anymore. It should be:
Books then Reviews then Fantasy, as my categories have been created (Fantasy chilf of Reviews and Reviews child of Books) but it doesn’t work like this and I don’t know why.
This is an important question IMO because if I only check the latest generation category then <?php the_category(‘, ‘) ?> only give me: Fantasy. Which is cool but if want to show the first parent category name: Books and then Fantasy, how do I do that? I checked and didn’t find anything, or maybe I missed it…
WordPress is amazing but sometimes it’s like ‘simple’ functions are missing, mostly when it comes to category management. Again, maybe I’m missing something, and if I do I’d be happy to learn 🙂
<?php the_category(', ','multiple') ?>
See Template_Tags/the_category
Thread Starter
Alkorr
(@alkorr)
Indeed. That works. Only if the latest generation category is checked. Otherwise, it gives something like:
Books, Reviews, Books, Fantasy
That’s why I wanted to know what were WordPress standards concerning categories meant to be checked when writing posts. Because most of the people I know that are using WordPress, have multiple categories assigned to a post.
Thank you very much for your replies, now I’m going to work on a big issue: how to manage my duplicate category names that can’t duplicate anymore (I know, it’s a dead end, but you can’t imagine how it is to lose an entire blog content you’ve been posting for years when you realize the latest versions of WP don’t accept duplicate category names/slugs anymore).
Thank you for your patience! 🙂