Hello, I’m trying to configure a Post Loop where selected posts must have a combination of multiple categories (AND instead of OR). I have no access to code, so this should be done via the widget interface on Page Builder. I tried many different ways using the additional query parameters field, but it does not work. It should be as simple as using a ‘+’ instead of a comma to separate category id’s. Like “cat=1+2” or “category_name=A+B” or “category__and=1,2” I’ve tried all those syntaxes and many others but none of them works as expected. I hope someone can help me out here.
Combining Multiple Categories in Post Loop Widget Not Working
This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.
Hi Guilherme.
Unfortunately, this is only possible by using PHP as it’s not possible to change the comparison operator from OR to AND via the interface directly. You can do this by using the siteorigin_widgets_posts_selector_query filter.
If you don’t have a method of adding PHP, please install Code Snippets. Once installed, please navigate to SnippetsAdd Newand add the following PHP:
Click Save Changes & Activate.
If you do have a method of adding PHP to your website, please add the above PHP using that method.
Kind regards,
Alex
Hello Alex, thanks for the help.
Unfortunately I don’t have access to PHP or to install new plugins in the structure I’m working on. Anyway, I’ll try a workaround, like using a certain category to mark the posts I want, but that isn’t the optimal form. I leave you with the suggestion of implementing this upgrade, like adding a radio select under the taxonomy field to choose between OR / AND relation. Or at least making the + sign work on the additional parameters field, since there already is a wp query parameter like (cat=1+2+3).
Best regards,
Guilherme
Hi Guilherme,
I’m sorry to hear that. I’ve logged your suggestion as a feature request with the rest of the team.
Kind regards,
Alex