Variable sidebar content
-
I have read the documentation on conditional tags and understand how to use them however with my sidbars being dynamic or with widgets i’m not sure where my conditional info needs to go.
This is my current sidebar code:
<div id="sidebar"> <div class="side1"> <ul> <?php jh_ShowAbout(); ?> <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?> <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?> <li class="blockr"> <h2>Archives</h2> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> </li> <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?> <?php endif; // end 1 Dynamic Sidebar ?> </li> </div> </div> </div> <!-- end left --> <div id="right"> <div class="side2"> <ul> <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?> <li class="blockr"><h2>Search This Site</h2> <?php include (TEMPLATEPATH . '/searchform.php'); ?> </li> <?php /* If this is the frontpage */ if (is_home()) { ?> <?php wp_list_bookmarks(); ?> <?php } ?> <li class="blockr"> <h2>Meta</h2> <ul> <?php wp_register(); ?> <li> <?php wp_loginout(); ?> </li> <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li> <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li> <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li> <?php wp_meta(); ?> </ul> </li> <?php endif; // end 1 Dynamic Sidebar ?> </ul> </div> </div>Can someone tell me how i can change so that it displays a different sidebar for a specific page. i.e. if (is_page(2))
In the <div class=”side2″> is where i need to vary the content
Thanks
The topic ‘Variable sidebar content’ is closed to new replies.