Hi,
I have to configure most sidebar and one for the custom post type doesn’t work ?
the variable print_r($xav_roots_cpt ); display 3.
Can I create several filter ?
392 // sidebar layout cpt
393 add_filter('roots_display_sidebar', 'roots_sidebar_layout_cpt');
394
395 global $xav_roots_cpt;
396 $xav_roots_cpt = $redux['layout_blog_archive'];
397 //print_r($xav_roots_cpt );
398 function roots_sidebar_layout_cpt($sidebar) {
399 global $xav_roots_cpt;
400 if ('recipes' == get_post_type() AND ( $xav_roots_cpt == 2 OR $xav_roots_cpt == 3 ) ) {
401 return true;
402 }
403 return $sidebar;
404 }
I made the mistake with my condition, every thinks is fine.
but this code test my custom post type for display my sidebar
2 and 3, display my sidebar or 1 for hide it.
I used reduxFramework with my variable $redux[‘layout_recipes’];
397 // sidebar layout cpt
398 add_filter('roots_display_sidebar', 'roots_sidebar_layout_cpt');
399
400 global $xav_roots_cpt;
401 $xav_roots_cpt = $redux['layout_recipes'];
402 function roots_sidebar_layout_cpt($sidebar) {
403 global $xav_roots_cpt;
404 if ('recipes' == get_post_type() AND ( $xav_roots_cpt == 2 OR $xav_roots_cpt == 3 ) ) {
405 return true;
406 }else if('recipes' == get_post_type() AND ( $xav_roots_cpt == 1)) {
407 return false;
408 }
409 return $sidebar;
410 }