Forums

[resolved] Comments go to wrong posts (4 posts)

  1. sebathuer
    Member
    Posted 3 years ago #

    Hi to everyone!

    I have the same problem describer here but I'm using the latest WP version. When some one adds a comment to a post, the comment goes to another post. When I reply, this reply goes to another post too. What's wrong?

    I'm using Glued theme an wp-comments.php looks good. See this code:

    <div id="comment_area">
    
    	<div id="loop_comments">
    
    		<a name="comments"></a>
    
    		<h2><?php _e("Comentarios", 'gluedideas_subtle'); ?></h2>
    
    <?php if ($comments) : ?>
    
    <?php foreach ($comments as $comment) : ?>
    		<a name="comment-<?php comment_ID() ?>"></a>
    		<div id="comment_<?php comment_ID() ?>" class="comment">
    			<dl class="metadata reduced">
    <?php if (function_exists('gravatar') && $aOptions['show_gravatar']) : ?>
    <?php if ($aOptions['gravatar_default'] ==  '') { $gravatar_default = get_stylesheet_directory_uri() . '/styles/' . $aOptions['style'] . '/gravatar.gif'; } else { $gravatar_default = $aOptions['gravatar_default']; } ?>
    				<dt class="comment_number gravatar">Gravatar:</dt> <dd class="comment_number"><a href="http://www.gravatar.com/" title="<?php _e('What is this?', get_bloginfo('name')); ?>"><img border="0" src="<?php gravatar($aOptions['gravatar_rating'], 40, $gravatar_default); ?>" class="gravatar" alt="" /></a></dd>
    <?php else : ?>
    				<dt class="comment_number"><?php _e("Comment Number:", 'gluedideas_subtle'); ?></dt> <dd class="comment_number"><?php $iCommentCount++; echo($iCommentCount); ?></dd>
    <?php endif; ?>
    				<dt class="writer"><?php comment_author_link() ?> <br /></dt>
    
                                    <dt class="timedate"><img src="<?php bloginfo('stylesheet_directory'); ?>/assets/flags/flag_<?php echo wp_ozh_getCountryCode(0,$comment->comment_author_IP); ?>.gif" width="18" height="12" alt="Desde <?php echo wp_ozh_getCountryName(0,$comment->comment_author_IP); ?>" align="absmiddle" />&nbsp;<?php _e("Escrito el:", 'gluedideas_subtle'); ?></dt>
                                      <dd class="timedate"><?php comment_date() ?> a las <?php comment_time() ?> <?php edit_comment_link('Edit','',''); ?></dd>
    			</dl>
    			<div class="content">
    				<?php if ($comment->comment_approved == '0') { echo('<p>Your comment is awaiting moderation.</p>'); } ?>
    				<?php comment_text() ?>
    			</div>
    		</div>
    
    <?php endforeach; ?>
    
    <?php else : ?>
    
    	<?php if ('open' == $post->comment_status) : ?>
    				<p><?php _e("Be the first to leave a comment!", 'gluedideas_subtle'); ?></p>
    
    	<?php else :  ?>
    				<p><?php _e("Sorry, comments are closed.", 'gluedideas_subtle'); ?></p>
    
    	<?php endif; ?>
    
    <?php endif; ?>    
    
    <?php if ('open' == $post->comment_status) : ?>
    
    	<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="form_comments" class="prominent reduced" onsubmit="urchinTracker('/wp-comments-post.php'); return true;"><div class="inner">
    
    		<h2><?php _e("Write a Comment", 'gluedideas_subtle'); ?></h2>
    		<p><?php _e("Take a moment to comment and tell us what you think.  Some basic HTML is allowed for formatting.", 'gluedideas_subtle'); ?></p>
    
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    		<p><?php _e("You must be logged in to post a comment.", 'gluedideas_subtle'); ?>  <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?php _e("Click here to login.", 'gluedideas_subtle'); ?></a></p>
    <?php else : ?>
    
    <?php if ( $user_ID ) : ?>
    
    		<p><?php _e("Logged in as", 'gluedideas_subtle'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. | <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account"><?php _e("Click to log out", 'gluedideas_subtle'); ?></a>.</p>
    
    <?php else : ?>
    
    		<p><input type="text" id="input_comments_name" name="author" value="<?php echo $comment_author; ?>" class="input standard" /> <label for="input_comments_name"><?php _e("Name", 'gluedideas_subtle'); ?> <?php if ($req) echo "(required)"; ?></label></p>
    		<p><input type="text" id="input_comments_email" name="email" value="<?php echo $comment_author_email; ?>" class="input standard" /> <label for="input_comments_email"><?php _e("E-mail", 'gluedideas_subtle'); ?> <?php if ($req) echo "(required)"; ?></label></p>
    		<p><input type="text" id="input_comments_url" name="url" value="<?php echo $comment_author_url; ?>" class="input standard" /> <label for="input_comments_url"><?php _e("Website", 'gluedideas_subtle'); ?></label></p>
    
    <?php endif; ?>
    
    		<p><textarea name="comment" id="input_comment" rows="10" cols="40" class="input textarea" ></textarea></p>
    
    		<p><input type="submit" id="input_comments_submit" name="submit" value="Submit Comment"/> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p>
    
    <?php do_action('comment_form', $post->ID); ?>
    <?php //live_preview(); ?>
    
    <?php endif; ?>
    
    	</div></form>
    
    <?php endif; ?>
    
    	</div>
    
    	<br class="clear" />
    
    	<script language="JavaScript" type="text/javascript" src="<?php bloginfo('template_directory'); ?>/assets/js/form_comments.js"></script>
    
    </div>

    I home someone can help me
    Thanks!

  2. sebathuer
    Member
    Posted 3 years ago #

    Anybody have an idea about this problem?

  3. sebathuer
    Member
    Posted 3 years ago #

    The fix: Don't use widgets on single post page (single.php). Very simple to do, but very complex to find the solution ;)

  4. Ivovic
    Member
    Posted 3 years ago #

    I was kind of hanging out for you to get some joy on this, because I was curious as to what might cause it.

    I can't think its actually related to *all* widgets, it must be something in one of your widgets which is making this happen.

    It would be cool to know which one.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags