• Is there anyway to list posts from all categories except ID xxx, xxx, xxx?

    Example: [list ID= ,-123,124,125,237]

    I’ve tried every combination that I can think of except typing every id to list. But that is really not an option as the categories will grow in numbers, and to remember adding all categories to list is not an option. It will be a lot easier to add the few that should newer be listed.

    https://wordpress.org/plugins/list-category-posts/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi, from the documentation in Other Notes:
    Exclude a category with the minus sign (-): [catlist id=11,-32,16]

    so if you have several categories to exclude, then I think you need to put a minus sign before each one. e.g [catlist id=-22,-45,-56]

    Thread Starter Stockhaus

    (@stockhaus)

    Hi AACT and thanks for your reply.

    I don’t think that I was clear enough. So this is what I would like to do:

    I would like to be abel to list all of my categories (226 at this moment, and growing in numbers) except a handful. How do I do that? I can’t really type all the category ID’s minus the handful that I do not want to list. Especially since I have built my site entirely on posts that has to be listed about 153 (and also growing in numbers) different ways. At this moment there is 1687posts that all should be listed somewhere on the site. About 600 posts and generic to all my customers and the rest is divided and specific posts for all the 153 customers containing protected information for each and every one of those customers. So in one place I have to list 600 posts containing category ID 1 and 100 posts that has category ID 1 + 2 for customer No1 and in an other place I have to list 600 posts containing category ID 1 and 100 posts that has category ID 1 + 3 for customer No2. And under no circumstances can ever customer No1 see the content of customer No2 and vise versa.

    Suggestions?

    Ah, I see. Yes I think I had misunderstood.

    So, if I’ve understood right this time: you can list those posts which have both category 1+2 OK but the problem is listing the ones that have ONLY category 1? Sorry, I can’t think how to do that.

    I wonder whether using custom post types and custom fields for your data structure rather than just relying on categories (as you say, you are ending up with hundreds of them) might help? For example, having one custom post type for orders, one for customers, one for products?

    There are plugins to help with managing customfields, e.g. Advanced Custom Fields.

    Try the following –
    [catlist id=-22,-45]
    using just the categories you dont want.

    Hi Ameet, unfortunately this wont work in this case as there are apparently many, many categories to exclude. Hence the suggestion above that a different approach be taken to managing what seems to be a data structure.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘list all categorys exept ID=xxx’ is closed to new replies.