Hi. I had asked a question in this thread:
which you answered beautifully. The solution given at the end worked. However, it doesn’t work for new posts. Can you help me fix it?
I have two sidebars. One, I want to appear on all shop pages, and all shop category pages. The second, I want to appear on the main blog page and all individual blog posts.
The latest post shows the “shop” sidebar instead of the “blog” sidebar.
https://sassypantsdesign.com/tighty-whitey-underwear-adventure-a-true-story/
Here is the code I am using. Thanks!
add_filter( ‘ups_sidebar’, ‘assign_sidebars’ );
function assign_sidebars($sidebar){
if(is_woocommerce()){
return ‘ups-sidebar-shop-sidebar’;
}
if (is_category()) {
return 'ups-sidebar-blog-sidebar';
}
return $sidebar;
}
