Thread Starter
Shojka
(@shojka)
P.S.
I created function to get primary category:
function func_get_yoast_primary_category( $atts ) {
global $post;
$cat_id = get_post_meta($post->ID, ‘_yoast_wpseo_primary_category’,true);
$term = get_term( $cat_id );
return $term->name;
}
add_shortcode( ‘get_yoast_primary_category’, ‘func_get_yoast_primary_category’ );
And i try to use in logic this:
func_get_yoast_primary_category($term->name) == ‘CATEGORY NAME’
But nothing happen, before i use other plugin and it works, but now
Hi @shojka , Thanks for using Widget Options! Do you mean that you want to show a specific widget on primary category archive page?
Thanks,
Mej
Thread Starter
Shojka
(@shojka)
Hello Mej,
I want to show specify widgets at single post. Ex. if post have categories A,B,C but primary category is set to A, i want to use only widget set to category A, dont want to show widgets for category B and C
Hi @shojka , The team reviewed it, and it turns out that the current version doesn’t support the conditions that target the primary category only.
But it’s been submitted to our list of features or change requests to be considered by our developers for future releases.
Thank you,
Mej