WordPress.org

Ready to get started?Download WordPress

Forums

Add a second sidebar?? (10 posts)

  1. PistonsNationBlog
    Member
    Posted 6 years ago #

    I would like to add a second side bar to my blog (www.pistonsnationblog.com). I have a side bar to the right, I'd also like to have one on the left, I'm not sure how to edit my stylesheet to make this happen I'm hoping someone can help :/

  2. kgn
    Member
    Posted 6 years ago #


  3. kgn
    Member
    Posted 6 years ago #

    Adding a second side bar?
    I'm just curious! why have many sidebars?

    Anyway, in order to edit your stylesheet.. you can go to the your current themes folder then the file called style.css...

    You can edit and change the style in here..

    hope it would help..

  4. nthnlsmmrs
    Member
    Posted 6 years ago #

    I can edit the CSS no problem and could add another sidebar manually but it won't work the same, it'll be static and I wouldn't be able to use widgets in it. My problem is simple, CSS and HTML are easy as pie for me... but this PHP and modular design is kicking me in the head every time I try to figure it out. The problem is that I have no idea what anything does.

    The main reason why I want another sidebar is that mine is getting rather cluttered and I don't like it. I want navigation on the left and ads/links/tags on the right.

  5. nthnlsmmrs
    Member
    Posted 6 years ago #

    Heh, I just realize that this isn't my pose from yesterday... but I have the same problem. If anyone could point myself and PistonsNationBl towards documentation on adding a sidebar or offer some code solutions that would be awesome.

  6. nthnlsmmrs
    Member
    Posted 6 years ago #

    Found this post, hope it helps. I'm about to test it out:
    http://wordpress.org/support/topic/133896?replies=2

  7. kgn
    Member
    Posted 6 years ago #

    Why not try to used the available wordpress themes with two side bar such as this one:
    http://www.onehertz.com/portfolio/wordpress/mandigo/
    ?
    Anyway just try to find the themes out there.. i'm sure there's one!

  8. CognitiveCombine
    Member
    Posted 6 years ago #

    My current theme has 4 sidebars for maximum customisation fun :)

    Anyway, I did it like this:

    functions.php:

    if ( function_exists('register_sidebar') )
    register_sidebar(array('name'=>'Sidebar 1',
    'before_widget' => '<div id="%1$s" class="side-c %2$s">', // Removes <li>
    'after_widget' => '</div>', // Removes </li>
    'before_title' => '<h3>', // Replaces <h2>
    'after_title' => '</h3>', // Replaces </h2>
    ));
    register_sidebar(array('name'=>'Sidebar 2',
    'before_widget' => '<div id="%1$s" class="side-c %2$s">', // Removes <li>
    'after_widget' => '</div>', // Removes </li>
    'before_title' => '<h3>', // Replaces <h2>
    'after_title' => '</h3>', // Replaces </h2>
    ));

    In my sidebar.php:

    <table border="0" width="100%" cellspacing="15">
    <tr>
    <td style="vertical-align: top;"><?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 1') ) ; ?></td>
    <td style="vertical-align: top;"><?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 2') ) ; ?></td>
    </tr>
    </table>

    Hope this helps.

  9. nthnlsmmrs
    Member
    Posted 6 years ago #

    Thanks, it took some tweaking but I got that code to work. The end result was:

    In functions.php

    if ( function_exists('register_sidebar') )
        register_sidebar(array('name'=>'sidebar1',
            'before_widget' => '',
        'after_widget' => '',
     'before_title' => '<h2 class="decay">',
            'after_title' => '</h2>',
        ));
    
    if ( function_exists('register_sidebar') )
        register_sidebar(array('name'=>'sidebar2',
            'before_widget' => '',
        'after_widget' => '',
     'before_title' => '<h2 class="decay">',
            'after_title' => '</h2>',
        ));

    and in my sidebar.php

    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar('sidebar1') ) : ?>

    All the default stuff

    <?php endif; ?>

    I'm not sure why your code didn't work right off for me. So I just modified the existing code to reflect the difference I noticed between the two. The confusion I was having before was that the template I was using didn't name the sidebar array so I didn't know one could differentiate between the two. Thanks for the help.

  10. chipwang
    Member
    Posted 6 years ago #

    nthnlsmmrs, can you put your CSS style you tuned out here ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags