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

BUG Taxonomy logic not working in versions higher than 2.2.7

vin

New member
Messages
2
Likes
0
Points
1
#1
Just found out that my Woody snippets that use taxonomy logic ("Taxonomy Equals MyCategoryName") are not showing. Did a rollback to version 2.2.7 and it's working fine again.
 

Temyk

Support team
Staff member
Messages
476
Likes
22
Points
18
#2
Hello.

The logic of taxonomies has changed slightly. This parameter specifies the taxonomy page, and not the post with the selected taxonomy.
 

vin

New member
Messages
2
Likes
0
Points
1
#3
Hi Temyk,

thanks, I didn't pick up on that. So how can I target posts with the selected taxonomy now?
 

Temyk

Support team
Staff member
Messages
476
Likes
22
Points
18
#4
We will return this feature in future updates.
In the meantime you can check the snippet code yourself:
PHP:
global $post;
$post_cat = get_the_category( $post->ID );
$needle_cat = get_the_category( '1' ); //Taxonomy ID
if ( isset( $post_cat[0] ) && isset( $needle_cat[0] ) ) {
    if($post_cat[0]->term_id === $needle_cat[0]->term_id)
    {
        //you code
    }
}