Title: comments problem in wordpress
Last modified: August 30, 2016

---

# comments problem in wordpress

 *  [My_month10](https://wordpress.org/support/users/my_month10/)
 * (@my_month10)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/comments-problem-in-wordpress/)
 * hi mrs.i have a problem with comment in wordpress.i placed comment_template in
   my single page.in comment form when i click on submit button it guide me to search
   page and any comment does not exist.please see the video and help me. tnx all.
 * my comment file :
 *     ```
       <?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">این مطلب خصوصی است.در صورتی که رمز آن را دارید در قسمت زیر وارد کنید.</p>
       	<?php
       		return;
       	}
       ?>
       <h3 id="comments"><?php	printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number() ),
       number_format_i18n( get_comments_number() ), '“' . get_the_title() . '”' ); ?></h3>
   
       <!-- You can start editing here. -->
       <div class="comments" id="comment">
       <?php if ( have_comments() ) : ?>
   
       	<div class="navigation">
       		<div class="alignleft"><?php previous_comments_link() ?></div>
       		<div class="alignright"><?php next_comments_link() ?></div>
       	</div>
   
       	<ol class="commentlist">
       	<?php wp_list_comments();//این کد دیگاه های نوشته شده را فراخوانی میکند ?>
       	</ol>
   
       	<div class="navigation">
       		<div class="alignleft"><?php previous_comments_link() ?></div>
       		<div class="alignright"><?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">نظرات بسته شده است.</p>
   
       	<?php endif; ?>
       <?php endif; ?>
   
       <?php if ('open' == $post->comment_status) : ?>
       <br />
       <div id="my-label">شما هم نظر خود را درمورد این پست به ما بگویید!</div><br />
       <div id="respond">
   
       <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
       <p>شما باید <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">وارد سایت شوید</a> تا بتوانید نظر دهید.</p>
       <?php else : ?>
   
       <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
   
       <?php if ( $user_ID ) : ?>
   
       <p>وارد شده به نام <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">برای خروج کلیک کنید </a></p>
   
       <?php else : ?>
   
       <p class="infirst"><label for="author"><small>نام <?php if ($req) echo "(لازم)"; ?></small></label>
       <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
       </p>
       </br>
   
       <p class="infirst"><label for="email"><small> ایمیل<?php if ($req) echo "(لازم)"; ?></small></label>
       <input type="text" name="email" style="text-align:left" <?php if ($req) echo "aria-required='true'"; ?> />
       </p>
       </br>
   
       <p class="infirst"><label for="url"><small>وبسایت</small></label>
       <input type="text" style="text-align:left" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
       </p>
       </br>
   
       <?php endif; ?>
   
       <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
   
       <p id="comment-para"><textarea placeholder="لطفا دیدگاه خود را بنویسید" name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
   
       <p><input name="submit" type="submit" id="submit" tabindex="5" value="ثبت نظر" />
   
       </p>
       <?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 ?>
       </div>
       ```
   
 * my single file :
 *     ```
       <?php
       get_header();
       ?>
       	<div class="content">
       		<?php include 'rsidebar.php' ?>
       		<div class="part2">
       			<div class="main-content">
       				<div class="main-content-title">
       					<?php the_title() ?>
       					<a class="fehrest-icon" id="main-content-icon" href="#"></a>
       				</div>
       				<figure id="single-con">
       				<div class="addrass">
       				<br/>
       				<?php
       				if(have_posts()){
       				the_post();
       				the_content();
       				}
       				comments_template();
       			?>
        			</div>
       			</figure>
       		</div>
   
       	</div>
       <?php get_footer(); ?>
       ```
   
 * my function file :
 *     ```
       <?php add_theme_support('menus');?>
       <?php add_theme_support( 'post-thumbnails' );?>
       ```
   
 * please help me to solve this problem.thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [10 years, 10 months ago](https://wordpress.org/support/topic/comments-problem-in-wordpress/#post-6392228)
 * Posting code like that doesn’t necessarily help. What theme is that and where’s
   it from?
 *  Thread Starter [My_month10](https://wordpress.org/support/users/my_month10/)
 * (@my_month10)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/comments-problem-in-wordpress/#post-6392237)
 * i created this theme with css & html and then i converted it to wordpress code.
   do you know what is my wrong?
 * watch this video:
    [http://www.mediafire.com/download/ifupq8ymx1ucxep/Rec003.avi](http://www.mediafire.com/download/ifupq8ymx1ucxep/Rec003.avi)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘comments problem in wordpress’ is closed to new replies.

## Tags

 * [comment not working](https://wordpress.org/support/topic-tag/comment-not-working/)
 * [comment-problem](https://wordpress.org/support/topic-tag/comment-problem/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [My_month10](https://wordpress.org/support/users/my_month10/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/comments-problem-in-wordpress/#post-6392237)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
