I think your theme not support dynamic sidebar.
Try this into sidebar.php
<div id="sidebar">
<ul>
<?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>
/* write here original sidebar contents, or keep nothing */
<?php endif; ?>
</ul>
</div>
Okay, that definitely worked. However, the old stuff is still there and the new sidebar is in the wrong place. Any idea how to solve this?
BTW, I wrote “keep nothing” and it didn’t change anything.
the old stuff is still there
Because you dont remove the code that output the old stuff.
/* write here original sidebar contents,
means:
If you want to show the old stuff when no widgets are specified,
replace ‘/* write here original sidebar contents, or keep nothing */’ with the code that output the old stuff.
or keep nothing */
means:
If you DONT want to show the old stuff anyway,
delete ‘/* write here original sidebar contents, or keep nothing */’ or dont edit the comment.
If you are confused, pls show your sidebar.php. I will fix it.
Still confused and can’t get it to work… Here is my sidebar.php
<div id="sidebar">
<ul>
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
<li><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 if ( is_home() || is_page() ) { ?>
<?php wp_list_bookmarks(); ?>
<li><h2>Meta</h2>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></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 } ?>
</ul>
<? $sg = 'banner'; include "templates.php";?>
</div>
<div id="sidebar">
<ul>
<?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?> keep nothing
<?php endif; ?>
</ul>
</div>
Thanks for your help.
This code will work fine for you:
<div id="sidebar">
<ul>
<?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
<li><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 if ( is_home() || is_page() ) { ?>
<?php wp_list_bookmarks(); ?>
<li><h2>Meta</h2>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></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 } ?>
<?php endif; ?>
</ul>
<? $sg = 'banner'; include "templates.php";?>
</div>