WordPress.org

Ready to get started?Download WordPress

Forums

Can I have the same widget in 2 different sidebars? (1 post)

  1. dannyfoo
    Member
    Posted 5 years ago #

    I've defined this in my functions.php.

    <?php
    if ( function_exists('register_sidebar') ) {
    	register_sidebar(array('name'=>'sidebarhome',
    	'before_widget' => '<div id="%1$s" class="widget %2$s">',
    	'after_widget' => '</div></div>',
    	'before_title' => '<h3 class="widgettitle">',
    	'after_title' => '</h3><div class="widgetcontent">',
    	));
    	register_sidebar(array('name'=>'sidebarpagepost',
    	'before_widget' => '<div id="%1$s" class="widget %2$s">',
    	'after_widget' => '</div></div>',
    	'before_title' => '<h3 class="widgettitle">',
    	'after_title' => '</h3><div class="widgetcontent">',
    	));
    } ?>

    And already placed the dynamic_sidebar code into my 2 sidebar files.

    I can see both sidebar options in my Widgets page but I can't seem to add the same widget to both of it. For example; I added Recent Comments to sidebarhome and saved. When I wanted to add Recent Comments to sidebarpagepost, the option to Add has been removed. As if I can only add a single instance of the Recent Comments widget.

    I noticed for the Text widget it doesn't have this problem, I can add it to both sidebar options.

    Therefore, I'd like to know if selected WordPress widgets can't be added to more than 1 sidebar.

    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic