Forums › Forums › Search & Filter Pro › Include AND exclude category
- This topic has 18 replies, 3 voices, and was last updated 5 years, 9 months ago by Anonymous.
-
Trevor(Private) December 21, 2018 at 11:45 am #197301
You may be able to do it using custom code, but it is not possible in the plugin settings. You would have to use the Edit Query Arguments filter.
Ross Moderator(Private) December 28, 2018 at 3:44 pm #197622Hi Jeroen
Sorry for the delay just picking this up now.
I have a question regarding the logic of what you are trying to do.
Including and excluding are not technically possible.
By default, everything is included.
So if you include a single category, all results will be restricted to what you just included, meaning, every other category will be automatically excluded (in effect), meaning you shouldn’t need to exclude anything else.
Take this example, a list of categories:
Blog Design Development
If I included “Design”, then the search would be limited to only:
Design
So
Blog
andDevelopment
would be excluded already – and there would be no need exclude anything.Does that make sense?
Thanks
Anonymous(Private) January 8, 2019 at 7:03 am #198257Hi ross, I understand what you mean. The problem is that I have about 20 categories and 10 search forms. There are forms where i want to include one category and exlude another, otherwise I have to exclude all categories which is quite some work.. But if there is no other way, I have to rest my case
Anonymous(Private) January 8, 2019 at 7:23 am #198259Ross, the exluding way does not work, I have a category aardrijkskunde which is ID 104, if I only include 104 the right results are shown, but if I exlude all categories except 104 (meaning id’s 155,98,157,103,154,139,133,158,156,106,1,101,99,97,140,159,105,100,9,113,102) I have no result at all.
Hope you can helpRoss Moderator(Private) January 8, 2019 at 1:13 pm #198328Hi Jeroen
Is it possible that when you exclude all other categories, that that you get no results, because the results have multiple categories?
So when you might expect there to be results when excluding all except 104, you don’t get any, because the results that would be in 104, also share some other categories which are in the exclude list?
Your original question states you want to include one category, and exclude another, surely, just doing an “include” on one category works because it excludes the others?
If I’m getting confused, please explain with clear example which outlines a few posts, what categories they have, and what settings do / do not work.
Thanks
Anonymous(Private) January 11, 2019 at 5:30 pm #198716Hi ross,
On the page https://www.itsacademy.nl/aardrijkskunde/ you see a filter which only shows the results from category ‘Aardrijkskunde’. All posts indeed have more than one category.When i want to exclude all posts in the results on this page with the category ‘Archive’, I indeed tried to exclude all categories except for ‘Aardrijkskunde’ and ‘Archive’, but that does not work because the postst have more than one category (like you say yourself).
Do you see any solution to this? So is there any possibility to show results fromn category aardrijkskunde but not from category Archive?
thanks
-
AuthorPosts