Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to know how to create a side bar on the left-side.I have a site containing a sidebar in the right side.I need a sidebar in the left side too. Please help me.

share|improve this question
add comment

closed as too broad by Eugene Manuilov, t f, s_ha_dum, Michael, toscho Oct 4 '13 at 15:04

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

  1. Register a sidebar in your functions.php using register_sidebar.
  2. Put some widgets in your sidebar from the dashboard (Appearance/Widgets).
  3. Show the sidebar on specific pages on your website by using dynamic_sidebar in your php code. Or you can create a sidebar-{your-sidebar-id}.php file and use get_sidebar to show the sidebar wherever you want.
  4. Use CSS / HTML to style your sidebar to appear on the left.

A working example:

functions.php

register_sidebar(array(
    'name' => 'sidebar-left',
    'before_widget' => '<div class="sidebar-box">',
    'after_widget' => '</div>',
    'before_title' => '<div class="widget-title">',
    'after_title' => '</div>'
    ));

sidebar-left.php

<div id="sidebar-left">
    <?php if ( function_exists('dynamic_sidebar') ) dynamic_sidebar('sidebar-left');?>
</div>

style.css

#sidebar-left { float: left; width: 300px; }
// modify to your needs.

// Example to show sidebar on the homepage index.php

<?php get_header();?>
// your code
// more of your  code
<?php get_sidebar('left');?>
<?php get_footer();?>
share|improve this answer
add comment

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