1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wordpress twentyten Seconday Sidebar

Discussion in 'Programming' started by izlik, Sep 15, 2015.

  1. #1
    Hi. I want a seconday sidebar in my twentyten theme. I have added the code bellow to functions.php and sidebar.php and the sidebar appear. The proble now is that the sidebar is under each other and i want them next to each other, how can i do this ?

    Example image: https://www.dropbox.com/s/9z33z8jj0irlp6f/wordp.png?dl=0

    <strong>FUNCTIONS.PHP</strong>

    function add_my_sidebars(){
    register_sidebar( array(
    'name' => 'My sidebar',
    'id' => 'my-sidebar',
    'description' => 'Just a little description',
    'before_widget' => '<div id="%1$s" class="widget-container %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );
    } add_action('widgets_init', 'add_my_sidebars');

    <strong>SIDEBAR.PHP</strong>

    <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    <div id="secondary" class="widget-area" role="complementary">
    <?php dynamic_sidebar( 'sidebar-1' ); ?>
    <?php dynamic_sidebar('my-sidebar'); ?>

    </div><!-- #secondary -->

    <?php endif; ?>
     
    izlik, Sep 15, 2015 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    You'll have to adjust the CSS for the theme. Probably the current CSS isn't made to cater for another sidebar, so, for instance, the main content area probably is too wide to allow the second sidebar to fit, also if the sidebars aren't floated, then they won't show up where you want them to be. Check the CSS, and try to manipulate and change it to fit both sidebars next to eachother.
     
    PoPSiCLe, Sep 15, 2015 IP