Grow your CSS skills. Land your dream job.

Sinking Sidebar – Sinking Heart :(

  • # May 12, 2010 at 1:46 pm

    Ok, this is starting to drive me crazy.

    The sidebar acts normally on all pages except for posts (single.php)
    But here’s the kicker, it displays fine if the user is logged in to wordpress, but if
    not the sidebar drops down into the main div.

    I can’t for the life of me figure this out and I’ve been at it for like two hours now,
    if anybody can help me figure this out I’d be very grateful.

    Cheers,
    Mike

    here is the site I’m working on: http://www.fingerstyleblues.com

    Here is the php code for the comments section

    Code:

    < ?php _e('Leave a Response','gravy'); ?>

    < ?php cancel_comment_reply_link(__('Cancel Reply','gravy')); ?>

    < ?php
    if ( get_option('comment_registration') && !$user_ID ) {
    _e('You must be','gravy');
    ?>
    /wp-login.php?redirect_to=< ?php echo urlencode(get_permalink()); ?>“>
    < ?php _e('logged in','gravy'); ?>

    < ?php
    _e('to post a comment.','gravy');
    } else {
    ?>

    /wp-admin/profile.php”>< ?php echo $user_identity; ?> • “>
    < ?php _e('Log out','gravy'); ?>
    »

    < ?php
    } else {
    ?>


    < ?php _e('Name','gravy'); ?>
    < ?php if ($req) { ?>

    < ?php _e('(required)','gravy'); ?>

    < ?php } ?>


    < ?php _e('Mail (will not be published)','gravy'); ?>
    < ?php if ($req) { ?>

    < ?php _e('(required)','gravy'); ?>

    < ?php } ?>


    < ?php _e('Website','gravy'); ?>

    < ?php
    }
    comment_id_fields();
    ?>
    ” />

    < ?php
    if (get_option("comment_moderation") == "1") {
    ?>

    < ?php _e('Please note: comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.','gravy'); ?>

    < ?php
    }
    ?>

    Code:
    /* ———- @ Comments ———–*/

    .reply a, .reply a:visited {
    width:75px;
    background:#CCC;
    color:#FFF;
    display:block;
    margin-bottom:15px;
    padding:5px !important;
    text-align:center;
    text-decoration:none !important;
    font:italic 1em Georgia,Arial,Verdana;
    position:relative;
    }

    .reply a:hover {
    background:#aeaeae;
    text-decoration:none;
    color:#FFF;
    }

    .reply a:active {
    background: #424242;
    color:#FFF;
    }

    .commentlist li {
    margin: 0 40px 22px 40px;
    padding: 15px;
    background:#F2F2F2;
    border:1px solid #DDD;
    list-style:none
    }

    .commentlist li li {
    border:none;
    border-left: 1px solid #CCC;
    margin:0 0 0 20px;
    padding-left:25px;
    background:none
    }

    .commentlist li.bypostauthor {
    background:#e5e5e5 !important;
    border:2px solid #CCC;
    }

    .commentlist code {
    background:#f2f2f2;
    padding:3px;
    }

    .avatar {
    margin: 3px 10px 0 0;
    float:left;
    padding:2px;
    border:1px solid #b9b9b9;
    }

    #trackbacklist li {
    margin: 10px 0 10px 35px;
    }

    #trackbacklist cite {
    font-style:normal
    }

    cite.fn {
    font: bold 1.4em Georgia, “Times New Roman”, Times, serif;
    letter-spacing:-0.05em;
    display:block;
    padding:9px 0 4px;
    }

    .says {
    display:none;
    }

    .comment-author {
    overflow:hidden;
    }

    .commentmetadata {
    float:left
    }

    .comment-date a, .comment-date a:visited {
    color:#9f9f9f;
    font-size:0.9em;
    text-decoration:none
    }

    .commentmetadata a:hover, .commentmetadata a:active {
    text-decoration:underline;
    color:#333;
    }

    # May 12, 2010 at 3:29 pm

    It looks like your sidebar.php is being included after the other content. Make sure it is included at the same position in your single.php as it is in your index.php.

    # May 12, 2010 at 3:31 pm

    Try this:

    Code:

    < ?php _e('Leave a Response','gravy'); ?>

    < ?php cancel_comment_reply_link(__('Cancel Reply','gravy')); ?>

    < ?php
    //If not logged
    if ( get_option('comment_registration') && !$user_ID ) {
    _e('You must be','gravy');
    ?>
    /wp-login.php?redirect_to=< ?php echo urlencode(get_permalink()); ?>“>
    < ?php _e('logged in','gravy'); ?>

    < ?php _e('to post a comment.','gravy');
    } else {
    //If logged
    ?>

    /wp-admin/profile.php”>
    < ?php echo $user_identity; ?>

    “>< ?php _e('Log out','gravy'); ?>»

    < ?php

    } else {
    ?>


    < ?php _e('Name','gravy'); ?>
    < ?php
    if ($req) {
    ?>

    < ?php _e('(required)','gravy'); ?>

    < ?php
    } ?>


    < ?php _e('Mail (will not be published)','gravy'); ?>
    < ?php
    if ($req) {
    ?>

    < ?php _e('(required)','gravy'); ?>

    < ?php
    } ?>


    < ?php _e('Website','gravy'); ?>

    < ?php
    }
    comment_id_fields(); ?>
    ” />

    < ?php
    if (get_option("comment_moderation") == "1") {
    ?>

    < ?php _e('Please note: comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.','gravy'); ?>

    < ?php
    }
    ?>

    # May 12, 2010 at 10:16 pm

    Tcione you are a lifesaver!

    Thank you so much, that worked perfectly!
    My heart is once again back in it’s normal position!

    Just for everyone’s general info I’m using the Gravy Framework to build this theme http://www.darrenhoyt.com/products/gravy/, I’ll go back and double check the other themes I’ve made with it, but this is the first time I noticed a problem. I’ll also send Darren a quick message if it turns out this is a bug in his code.

    Thanks again, man I love css-tricks!
    Cheers,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".