Support » Fixing WordPress » Writing post: selecting child and parent category in one click

  • Hello

    I have a blog with multiple authors, some who aren’t systematic in the way they select (child) sub-categories when posting

    So for example, a (parent) category and sub-cats is set up like this:

    – film
    – books
    – art

    When an author writes a book review, they should check both Reviews and books.
    Is it possible to set things up that if books is checked, Reviews get checked to automatically? So basically I’m asking, if a child gets selected, the parent gets selected too.

    Also, it is possible that if a non-default category is checked, the default category gets un-checked


Viewing 10 replies - 1 through 10 (of 10 total)
  • In your Administration > Options > Writing panel under Writing Options, why not make your Default post category be “Reviews”. Then your authors only have to check the “Book” Category.


    I have more than one set of parent category (and sub-cats), and the default isn’t set to Reviews. I just used it as an example
    (In fact, I’d like it so that there’s no default post category, but that’s for another time, and doesn’t solve this issue)

    It has to have a default category – exactly because of users like yours. If a post would be saved without a category (like user forgets to check one) that would screw up your whole blog 😉

    Ok, I get that a default category needs to be set

    An alternative would be to make sure at least my other contributors see the dropped down list of categories when writing a message
    Can it be hacked that the category list is always shown (so can’t be closed)?


    I’d love to see this feature added, as well. I can’t really see a scenario where you wouldn’t want the parent category to be selected when the child is, but I figure it’s easier to select it automatically but have the option of deselecting it later still available. Just my $.0.02

    Owen’s Limit Categories is a start where each Role can have a different default Category.

    Careful, though – Limit Categories doesn’t allow you to specify more than one default category per role, just separate default categories for each role.

    Nonetheless, I can see how you might use it as a model for creating such a setup. Automatically checking and unchecking categories based on some specific criteria will likely require some javascript skill.

    On a separate note — Why do you need to check both the Reviews and Books categories if Books is inside Reviews? When you query the Reviews category, it should return all post that are in Reviews or any of its child categories.

    If it were me (and I do have my own categories set up this way), I would only check the deepest level category (“Books” in this case) and then let WordPress do the work. I would then use Limit Categories to limit that type of user to only the subcategories of “Reviews”. That way, they can’t check the “Reviews” category, just the ones that are returned when querying for Reviews or for those categories directly.

    I hope that made sense… It sounded kind of convoluted.

    ringmaster, thanks for your enlightening post 🙂

    Doh! I’m still new to WP and didn’t realise that if you post in a child, it also gets filtered via its parent. So when I click on Reviews in the sidebar, any post with reviews or books is displayed

    Now using your limit categories plugin, I could exclude posting to the parent Reviews

    But then again, when does it matter that a parent is checked also, if a child is selected anyway?
    I can think of that in the post, where it indicates filed under, you would only get to see the child category being listed. Apart from that, would it affect anything else?

    Well, say that you have multiple children categories (for example, the child category “Reviews”) under the parent categories “Movies”, “Books”, and “Games”? Like this:

    – Movies
    — Blah1
    — Blah2
    — Reviews
    – Books
    — Blah3
    — Reviews
    – Games
    — Blah4
    — Reviews

    When the list of categories for a post is displayed, if the parent category isn’t checked, it will only list the category as “Reviews” but not include more information than that. Is it a movie review? A book review or a game review? If the parent category is also displayed, then there’s no question as to which kind it is.

    Yes, the user can check both parent and child categories for each post, but it seems like it would speed things up to have an option to auto-check the parent category if the child category is chosen. The post is going to show up in the parent category anyway, so why not mark it as so?

    Is there any plugin or other modification that would prevent searches from including children automatically? I’ve primarily used the hierarchy of parent & child cats to make browsing categories easier for users, however, they’re not “logically perfect” in the sense that occasionally, posts may fit into a child category, but not its parent.

    My primary need for this is while doing searches; if my query is ?s=search+term&cat=2,7 and cat 2 is a parent category, I get all posts in cat 2’s child categories, even if they don’t belong to category 2 specifically. I am using the Intersect plugin and it chokes on this functionality, only joining the two categories specifically named, but requiring that WHERE = all the child categories (at least I think I’ve got that understood correctly!).

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Writing post: selecting child and parent category in one click’ is closed to new replies.