• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Conditional execution logic for the snippet

RunPee

New member
Messages
2
Likes
0
Points
1
#1
I have a snippet that has the conditional execution logic as such:
Do Not Display IF
* Taxonomy > Equals > "Anything Extra"
* Page > Equals > "All Pages"

The 2nd rule — All Pages — works, but not the first rule. I have content using the category "Anything Extra" but the snippet is still displayed.

I have checked, and double checked, that the post that I'm testing on does indeed use the category "Anything Extra."
categories.png


Thanks for any advice on how to address this.
snippet.png
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

Additional taxonomy logic works differently. In your example, the snippet will not be displayed on the taxonomy page itself http://example.com/category/anything-extra

We plan to expand the additional logic in the upcoming updates.
For now you can use this PHP code in your snippet:
PHP:
<?php
if( !has_category('anything-extra') ) //anything-extra   - it's a slug of category
{
    //your code
}
?>
 

RunPee

New member
Messages
2
Likes
0
Points
1
#3
That did it. Thanks.

Great support should be rewarded. I'll purchase the pro version, even though I don't need it.