Support » Themes and Templates » Problem in single.php but not on posts or category page

Viewing 8 replies - 1 through 8 (of 8 total)
  • 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="" 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" />


    Your a genius. Thanks for that.

    Hello again.

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

    Your assistance would be appreciated again


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

    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

    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; ?>

    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) : ?>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Problem in single.php but not on posts or category page’ is closed to new replies.