I am having trouble combining conditional tags for categories and pages.
I want a widget to show up on all pages except one page and three category archives as well as their individual posts.
To exclude it from the page, I’ve successfully used:
To exclude it from categories 6-9 and their posts, I’ve successfully used:
!is_category( array (6, 7, 8, 9)) || (!is_single() && in_category( array (6, 7, 8, 9)))
However, when I try to combine the two using || the exclusions fail and the widget shows up on every page.
!is_category( array (6, 7, 8, 9)) || (!is_single() && in_category( array (6, 7, 8, 9))) || !is_page(‘xxx’)
fails, despite each part working individually. I’ve tried the page slug and the page id, but that didn’t help. I’ve also, based on some input from other searches, tried && instead of || to no avail.
Do you see what I am doing wrong or is it not really possible to combine the two different sorts of conditionals?
- The topic ‘[Plugin: Widget Logic] Two different kinds of conditionals for same widget?’ is closed to new replies.