Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6601007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:41:51+00:00 2026-05-25T18:41:51+00:00

I’m using this code to make #sidebar ‘s height match #post_content ‘s height: <script

  • 0

I’m using this code to make #sidebar‘s height match #post_content‘s height:

<script type='text/javascript'>
$().ready(function(){
   $('#sidebar').height($('#post_content').outerHeight(true)); 
});
</script>

This works on the homepage: http://themeforward.com/demo2/ and even on a posts page without comments… but once comments are added they no longer match heights: http://themeforward.com/demo2/2011/01/02/centered-and-captioned-image-longer-title/

To illustrate the problem I have made the post_content div background color black and the sidebar background color gray.

Here is my CSS:

#container {
    width:1126px;
    margin:35px auto;
    padding:0;
    background:#000;
    clear:both;
    overflow:hidden
}
#sidebar {
    display:inline-block;
    float:right!important;
    width:410px;
    padding:0 0 0 25px;
    overflow:hidden;
    background:#AAA;
    border-left:1px solid #EEE
}

Here is my comments.php:

<?php

// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');

if ( post_password_required() ) { ?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
?>

<!-- You can start editing here. -->

<?php if ( have_comments() ) : ?>
<div class="responses"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;<?php if ( comments_open() && ( 4 <= get_comments_number()) ) : ?>
<a href="#respond">»</a>
<?php endif; ?>
</div>

<div id="commentlist">
<ul>
<?php wp_list_comments('avatar_size=60'); ?>
</ul>
</div>

<div id="more_posts_comments">
<div class="oe"><?php previous_comments_link() ?></div>
<div class="re"><?php next_comments_link() ?></div>
</div>

<?php else : // this is displayed if there are no comments so far ?>

<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->

<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>

<?php endif; ?>
<?php endif; ?>

<?php if ('open' == $post->comment_status) : ?>

<!-- Respond to this -->
<div id="respond">
<div class="responses"><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></div>
<div class="cancel_comment">
<?php cancel_comment_reply_link('cancel comment'); ?>
</div>


<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<!-- If the user is logged in... -->
<?php if ( $user_ID ) : ?>

<div class="logged-in"><p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a> - <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out</a></p></div>

<?php else : ?>

<!-- If the user isn't logged in, they need to fill out these forms... -->
<div id="small_forms">
<input type="text" onfocus="clearDefault(this)" onblur="if(this.value=='')this.value='Name (required)';" value="Name (required)" name="author" id="author" size="22" tabindex="1" />
<input type="text" onfocus="clearDefault(this)" onblur="if(this.value=='')this.value='E-Mail (required, hidden)';" value="E-Mail (required, hidden)" name="email" id="email" size="22" tabindex="2" />
<input type="text" onfocus="clearDefault(this)" onblur="if(this.value=='')this.value='Website';" value="Website" name="url" id="url" size="22" tabindex="3" />
</div>

<?php endif; ?>

<div id="submit_spacer"><h6><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></h6></div>

<!-- Submit button -->
<h6><input name="submit" type="submit" value="Submit Comment" class="submit" /></h6>

<h6><?php comment_id_fields(); ?></h6>

<?php do_action('comment_form', $post->ID); ?>

</form>

<?php endif; // If registration required and not logged in ?>
</div>

<?php endif; // if you delete this the sky will fall on your head ?>
enter code here
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:41:52+00:00Added an answer on May 25, 2026 at 6:41 pm

    You can easily achieve the same effect with pure css by positioning your sidebar absolutely to the container div. Try this:

    add:

    #container {
       position:relative;
    }
    
    #sidebar {
       position:absolute;
       top:0;
       right:0;
       bottom:0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.