• Resolved Alkorr

    (@alkorr)


    I have a problem using Categories in WordPress and talking with some friends, it appears none of them found the best solution.

    I explain: I have several categories, all are hierarchical:

    Books
    – Reviews
    — Fantasy

    Games
    – Reviews
    — Fantasy

    I used to check all the categories when I write a post: Books + Reviews + Fantasy. But I realized I could only check the last category (Fantasy) and it’s working perfectly.

    So my question is: is selecting only the last cateogry is the correct use of categories in WordPress? The question may sound stupid but it changes the way certain functions work (like the_category).

    If you can shed a light about that, that would be greatly appreciated, so I can finally know if I (we) use WordPress properly ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How many Categories to select?’ is closed to new replies.