• Hi there. I am pretty new at this and learning how to customize my theme, etc.

    I have actually successfully added a second sidebar into my theme. It comes up on my dashboard fine, I can drag widgets into it, etc. The only problem is when I put it in the index.php file, my posts push the sidebar down. In other words, it isnt fixed like the right sidebar is. I used this code in the index …

    <?php include (‘sidebar2.php’); ?>

    Wherever I seem to place it, the same thing happens. This should be pretty easy to resolve for someone experienced. PLEASE HELP!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Give your second sidebar template file a name like sidebar-two.php and then use <php get_sidebar('two');?>.

    Anything else is likely to be a validation/markup problem or a CSS issue but you’d need to post a link to your site if you would like more specific help.

    Thread Starter confessyoursecret

    (@confessyoursecret)

    Thanks for responding so quickly. my site is https://confessyoursecret.com

    if you see, there is a sidebar on the right. when i put
    <?php include (‘sidebar2.php’); ?> in the index, the sidebar appears on the left, but the posts are on top of it. Therefore posts would “push” the sidebar down. I don’t have the sidebar in now because I didn’t want to fool with it anymore. I did create a sidebar2.php file in my theme folder. Basically, everything seems to work except the placement. I can easily drag widgets into “sidebar2” on the dashboard. The sidebar was successful, it just gets pushed down by any posts.

    Thread Starter confessyoursecret

    (@confessyoursecret)

    Ok.. so i ended up putting the code back in so you can see exactly what is happening.

    this is what my index looks like

    <?php
    /**
    * @package WordPress
    * @subpackage Cute_Bubbles
    */

    get_header(); ?>

    <div id=”theREALleft”>

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>
    <div class=”titleAndMeta”>
    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
    <div class=”metaDate”>Posted <?php the_time(‘l, F jS, Y’) ?></div>
    <div class=”metaCommentsEdit”><?php the_tags(‘Tags: ‘, ‘, ‘, ‘
    ‘); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></div>
    </div>
    <div class=”realPostItem”>
    <?php the_content(‘Read the rest of this entry »’); ?>
    </div>

    <?php endwhile; ?>

    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(‘« Older Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Newer Entries »’) ?></div>
    </div>

    <?php else : ?>

    <h2 class=”center”>Not Found</h2>
    <div class=”realPostItem”>Sorry, but you are looking for something that isn’t here.</div>
    <?php get_search_form(); ?>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php include (‘sidebar2.php’); ?>

    <?php get_footer(); ?>

    and if you go to https://confessyoursecret.com you will see what it does. i added a calendar widget just so you can see where the sidebar is and what its doing.

    I think you need to start by giving the left sidebar an id or class of its own so that it can be styled via CSS. Then you need to include it before <div id="theREALleft"> so that it can be floated to the left of the post area.

    Thread Starter confessyoursecret

    (@confessyoursecret)

    how do i give it an id or class? sorry i am such a beginner. ??

    Doesn’t really matter but since your other sidebar uses an id, try using something like id="MyLeft" for the new one.

    Thread Starter confessyoursecret

    (@confessyoursecret)

    i tried to just include it before

    <div id=”theREALleft”>

    this caused the right side to be pushed down. then i put the code to both sidebars above <div id=”theREALleft”>
    and now you will see what has happened. https://confessyoursecret.com

    perhaps once i give it an id or class that should help? or do i need to reconfigure the actual post area? humph

    Thread Starter confessyoursecret

    (@confessyoursecret)

    hmm.. i actually like what i did. i made a top sidebar. but i really still want a left sidebar.

    Thread Starter confessyoursecret

    (@confessyoursecret)

    PS.. thanks for taking time to help me ??

    Do you need any more help on this?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Added a sidebar, having a few issues.. please help!’ is closed to new replies.