Support » Fixing WordPress » Editing Dynamic Sidebar

  • One of the themes I am using has a Dynamic Sidebar in it and I don’t have any experience with this. Whenever I add new widgets to it, it screws up the way the sidebar looks completely.

    Here is the sidebar script:

    <!-- begin sidebar -->
    <div id="sidebar">
    	<?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
    
    <ul>
    	<li>
    
    		<h2><?php _e('Menu'); ?></h2>
    		<ul><?php wp_list_pages('depth=1&title_li=' ); ?></ul>
    	</li>
    	<li>
    		<h2><?php _e('Categories'); ?></h2>
    		<ul>
    		<?php wp_list_cats(); ?>
    		</ul>
    	</li>
    
    	<li>
    		<h2><?php _e('Archives'); ?></h2>
    		<ul>
    		<?php wp_get_archives('type=monthly'); ?>
    		</ul>
    	</li>
    
    	<?php if ( is_home() ) { get_links_list(); } ?>	
    
    <?php endif; ?>
    </div>
    
    <!-- end sidebar -->

    How do I add in tags, recent posts and such? I tried replacing ‘archives’ with ‘tags’ but it didn’t work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • As soon as you add 1 widget, all of your default sidebar content will disappear. so if you want to retain Pages, Archives and Categories, you’ll need to add those back in as widgets.

    Hi,

    Dynamic sidebar always load whenever there is no widget added to your theme from wordpress admin area. Once you add any widget then it will load the static sidebar widgets that are added from the wordpress admin area.

    Thanks,

    Shane G.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Editing Dynamic Sidebar’ is closed to new replies.