Advance Post Block Filtering

Posted in: Newspaper
Post count: 7

I have run into several situations where I would like to be able to filter the posts displayed in a block by multiple categories. I haven’t been able to figure out how to only display posts that have both Category A and Category B assigned to them.

If I add both category ID’s to the filter all posts with those categories are displayed whether they have one or two assigned to them, but what I’m looking for is to only display posts with both categories assigned to them.

Does anyone know how to accomplish this?

Post count: 20685

Hi,

The block filtering will not check if the post belongs to both categories, before displaying them. It will show posts that belong to each of the categories you enter in the filter. There is no filtering available that would have that functionality.
Maybe you can find a different way of displaying the posts you want in the blocks, using the present sorting and filtering
https://forum.tagdiv.com/block-settings-tutorial/

Thanks

Post count: 7

I’ve tried every combination of sorting and filtering I could think of to accomplish this. Sadly, short of creating several thousand custom categories it doesn’t seem possible.

Is there any way you could tell me which theme file calls the filtering function so I can change the logic from (CatA OR CatB) to (CatA AND CatB)?

Post count: 20685

Hi,

That might not be an easy task, you could try to make modifications in this file
https://www.screencast.com/t/41RnU2ucO
But there could be need for changes in other files, this could require multiple modification. Then testing to see if it works properly.

Thanks

Post count: 8

Hi, I had the same problem. I added to each post a tag that consisted of Cat A+B and then filtered blocks by this tag.

Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.