Hello @Mbzo,
You have added this code:
add_filter( 'ups_sidebar', 'custom_sidebar_on_pages', 9999 );
function custom_sidebar_on_pages ( $default_sidebar ) {
if ( in_category( array ('noticias','destaque','publicacoes','video') ) ) {
return 'ups-sidebar-projetos';
} elseif ( in_category('quem-somos') ) {
return 'ups-sidebar-institucional';
}
return $default_sidebar;
}
This will only assign custom sidebar to single posts that belongs to a particular category. It does not assign any sidebar to a category archive pages. You may need to update your code and use this instead:
// Category Archive Sidebars and Posts Sidebars
// https://theme.co/apex/forum/t/custom-sidebars-for-category-pages/32936/4
// =============================================================================
add_filter( 'ups_sidebar', 'custom_sidebar_on_pages', 9999 );
function custom_sidebar_on_pages ( $default_sidebar ) {
// for single posts
if ( in_category( array ('noticias','destaque','publicacoes','video') ) ) {
return 'ups-sidebar-projetos';
} elseif ( in_category('quem-somos') ) {
return 'ups-sidebar-institucional';
}
// for category archive pages
if ( is_category( array ('noticias','destaque','publicacoes','video') ) ) {
return 'ups-sidebar-projetos';
} elseif ( is_category('quem-somos') ) {
return 'ups-sidebar-institucional';
}
return $default_sidebar;
}
// =============================================================================
For your reference, is_category and in_category are two independent conditions.
Hope this helps.