elseif ( is_active_sidebar( 'sidebar-optional-archive' ) && ( is_archive() || ( is_home() && $page_id != $page_for_posts ) ) ) {
dynamic_sidebar( 'sidebar-optional-archive' );
}
states that the page_for_posts (or blog page) should display the optional sidebar for archives if it's active.
In my case, it is active, and it is displaying correctly as such on the blog-category page (determined by is_archive in the same code lines). However, on the page_for_posts (blog-page), where the most recent posts are shown, there is still the primary sidebar.
I'm using a static homepage and use a page called "blog" as the page_for_posts (via Wordpress dashboard -> settings -> reading). It seems that this page is still considered a "page" after all and thus showing the primary sidebar...
Can you please help me with this? Thank you very much!
Kind regards,
Henriët
PS: http://test.gewoonmooigewicht.nl; site is still under construction
Posts_page uses primary sidebar, while it should use archive sidebar
Hello team,
I've got another problem with sidebars, unfortunately!
If I read this correctly, the following code from the sidebars.php: