Sidebar logic for post/blogroll and page type
-
I’ve spent all night trying to solve this and it is driving me mad.
I have 2 sidebars setup. Sidebar1 is used throughout the site on only static pages. The other is to be used on post pages and the blogroll page, where all posts are shown. Here is the code that I’ve got in sidebar.php:
<?php if(is_singular($post)): ?> <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ): endif; ?> <?php else:?> <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : endif; ?> <?php endif;?>
This nearly works on the blog roll page, but when you click into a post the logic fails and sidebar 1 is called instead of sidebar 2.
Here is what I want:if: this page is a static page then show sidebar1 elseif: this is post content type - show sidebar2 else: this is a blogroll show sidebar2
I’ve looked at slayer’s widget plugin and widget logic and could not get them to work on the blogroll pages (ie not widget’s were shown). Other people have been asking for the fixes to these bugs – nothing yet.
This is frustrating, surely someone has done something similar please help!
- The topic ‘Sidebar logic for post/blogroll and page type’ is closed to new replies.