• Hi,

    I am currently using the Upstart Blogger Minim theme, which is perfect for my slow server because it’s a minimalist theme. I just do not want to have to find another theme, so here goes.

    HOW DO I ADD A NEW SIDE BAR TO MY BLOG?
    I am aiming for a right side bar next to the post, and possibly a footer if possible. I’ve googled for some tutorial, and found one that looks promising. However, I followed its instruction and ended up with 6 sidebars, instead of 4 (originally 3) so I’m sure I am doing something wrong.

    Help would be appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fr0s3in

    (@fr0s3in)

    Oh, srry: here is the current unedited function file.

    Function:

    <?php
    if ( function_exists(‘register_sidebar’) )
    register_sidebars((3),array(
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h3>’,
    ‘after_title’ => ‘</h3>’,
    ));
    ?>

    Hi fr0s3in

    i’m just a completely self taught, very amateur coder and I learn as I go along. So although what i’m about to tell you does work for me, I would fully recommend you get it checked through with somebody who 100% knows exactly what is going on!

    I was having the exact same problem as you, with the same theme. I also came across the same article that you did explaining how to add a sidebar!

    That method does work, but with a couple of changes:

    You need to change the register_sidebars((3) in function.php to:

    register_sidebars((4)

    keep the rest of function.php the same.

    Next, you need to change:

    <?php get_sidebar(); ?>

    to:

    <?php include (TEMPLATEPATH . '/sidebar1.php'); ?>

    You also need to include a div tag in style.css

    I made mine this, but only because it worked!:

    #sidebar2 {
    float: right;
    padding: 0 0 0 50px;
    }

    Don’t forget that you also need to change the entire width of #container in style.css to something that allows for your extra sidebar. I made mine 1090px

    Now you have all this sorted, you need to add the call to your index.php. I have shown below the beginning of my index template with the added code in bold…hope it works for you!!

    <?php get_header(); ?>

    <div id=”container”>

    <div id=”sidebar2″>
    <?php include (TEMPLATEPATH . ‘/sidebar2.php’); ?>
    </div>

    <div id=”entries”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    I hope this has been of some use to you, this works in both IE and FF.

    Don’t forget that you wont see anything until you add some text into your newly formed sidebar2.php file.

    Here is my site if you want to see what mine looked like

    The West Ham Process

    Regards, Sam

    Just a very quick thought also that I forgot to mention, you must make sure to make the relevant changes to single.php

    so once again, change <?php get_sidebar(); ?>

    and also add:

    <div id=”sidebar2″>
    <?php include (TEMPLATEPATH . ‘/sidebar2.php’); ?>
    </div>

    between the div tags for container and entries

    regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding a sidebar’ is closed to new replies.