0

Can anyone help me on how to add two sidebars on the main page of my WordPress site. I need one on the left and the right. I'm new to WordPress and don't know much about the code, even when I tried reading the codex. My website is here I am using a Ready To be theme, with Ready E-Commerce plugin

1

Use this in your funtions.php to register sidebar

if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Sidebar ',
        'id'=>'sidebar',
        'before_widget' => '<div>',
        'after_widget' => '</div>',
        'before_title' => '<p>',
        'after_title' => '</p>',
));

To use it in your theme use the following

<?php 
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar') ) :
    endif;
?>

Refer this to know more : http://codex.wordpress.org/Function_Reference/register_sidebar

  • Okay, so I will just put both of these into functions.php right? – lozadaOmr Nov 11 '13 at 8:35
  • No...use the first one in functions.php. Use the second one in your template page to call the sidebar instead of get_sidebar() – MidhuN Nov 11 '13 at 8:37
  • Can you mark it as the "answer" if you have got what you were looking for? – MidhuN Nov 11 '13 at 10:47
1

use register_sidebar function.register sidebar.

for using on your themes;

<?php if ( is_dynamic_sidebar('sidebar-name') ) {
        dynamic_sidebar('sidebar-name');
    }
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.