Problem in single.php but not on posts or category page (9 posts)

  1. kilpatrick
    Posted 6 years ago #

    Hi there.

    Your help would be appreciated with this template issue. I am running the egecia theme on 2.7. I increased the size of the template from 800 to 900 and halved the extra size 50/50 between the left and right columns.

    I have a rather annoying problem in that the site displays fine in post and category pages but on the single.php page the right sidebar starts to display below the left content.

    posts - http://holderness-coast-fishing.co.uk/
    category - http://holderness-coast-fishing.co.uk/?cat=5
    single - http://holderness-coast-fishing.co.uk/?p=31

    Here is the stylesheet


  2. SimonJ
    Posted 6 years ago #

    I would say, since the only main difference between your single.php and the other files is the comment template, that the problem comes from comments.php

    You have a lost </div> at the end of your comments.php, wich close the main wrapper (div="content")

    If you put a div just before your <h3>Leave a Reply</h3>, it should do the trick...

    <div> <---- THE MISSING DIV
    <h3>Leave a Reply</h3>
    <form action="http://holderness-coast-fishing.co.uk/wp-comments-post.php" method="post" id="commentform">
    <p><input type="text" name="author" id="author" value="" size="22" tabindex="1" />
    <label for="author"><small>Name (required)</small></label></p>
    <p><input type="text" name="email" id="email" value="" size="22" tabindex="2" />
    <label for="email"><small>Mail (will not be published) (required)</small></label></p>
    <p><input type="text" name="url" id="url" value="" size="22" tabindex="3" />
    <label for="url"><small>Website</small></label></p>
    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="31" />


  3. kilpatrick
    Posted 6 years ago #

    Your a genius. Thanks for that.

  4. kilpatrick
    Posted 6 years ago #

    Hello again.

    The original problem was solved. But it came back again when someone made a comment.

    Your assistance would be appreciated again

  5. kilpatrick
    Posted 6 years ago #


  6. drewactual
    Posted 6 years ago #

    find the comments template and add a closing div at the bottom. as in the last thing on it.

  7. kilpatrick
    Posted 6 years ago #

    Thanks for your support on this. Its not yet solved though.

    When I add a closing div to the template.php it solves the problem. But then when you view a post without any comments on it, the problem reappears.

    for example :


    I am viewing in FF

  8. kilpatrick
    Posted 6 years ago #

    Think I have now solved this with a little help from another related topic on here.

    There is a missing div but its missing from a conditional part of the code. If the single.php has comments present then the div is in existance. If the single.php has no existing comments then another bit of code is invoked and the <div> is missing.

    The <div> needs inserting here. Please see the bold div. :

    <?php if ($comments) : ?>
    <div id="comments">
    	<h3><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>
    	<ol class="commentlist">
    	<?php foreach ($comments as $comment) : ?>
    		<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
    			<?php echo get_avatar( $comment, 32 ); ?>
    			<span class="commentsName"><?php comment_author_link() ?></span> Says:
    			<?php if ($comment->comment_approved == '0') : ?>
    			<em>Your comment is awaiting moderation.</em>
    			<?php endif; ?>
    			<div class="commentsDate"><a>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','��',''); ?></div>
    			<?php comment_text() ?>
    		/* Changes every other comment to a different class */
    		$oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
    	<?php endforeach; /* end for each comment */ ?>
     <?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.
    	<?php endif; ?>
    <?php endif; ?>
  9. kilpatrick
    Posted 6 years ago #

    sorry cant get the bold bit to show. But its the div between the strong tags

    <?php else : // this is displayed if there are no comments so far ?>
    <?php if ('open' == $post->comment_status) : ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.