• I try to add comment form to my own template of page but it doesn’t work (I mean the comment form does not appear). I don’t know why because I think it must work. Template file reviews.php:

    <?php
    /*
     * Template Name: Reviews
     */
     get_header(); ?>
    <div class="container page">
       	<h2>Отзывы</h2>
    
        <?php
    
        comments_template();
    
    ?>
    
    <?php comment_form();?>
    
    </div>
    <?php get_footer(); ?>

    Screenshot of output:
    https://imageshost.ru/img/2016/08/28/f8ab0e88d262299e94ee763fb309ca436116e267.png

    Snippet of comments.php (i’m using the example of Twenty Thirteen theme):

    <div id="comments" class="comments-area">
    
    	<?php if ( have_comments() ) : ?>
    		<ol class="comment-list">
    			<?php
    				wp_list_comments( array(
    					'style'       => 'ol',
    					'short_ping'  => true,
    					'avatar_size' => 74,
    				) );
    			?>
    		</ol><!-- .comment-list -->
    
    		<?php
    			// Are there comments to navigate through?
    			if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
    		?>
    		<nav class="navigation comment-navigation" role="navigation">
    			<h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1>
    			<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentythirteen' ) ); ?></div>
    			<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentythirteen' ) ); ?></div>
    		</nav><!-- .comment-navigation -->
    		<?php endif; // Check for comment navigation ?>
    
    		<?php if ( ! comments_open() && get_comments_number() ) : ?>
    		<?php endif; ?>
    
    	<?php endif; // have_comments() ?>
    
    </div><!-- #comments -->

    I don’t know why but the comment form doesn’t appear. But as you can see everything is ok about the list of comments. But where is the comment form?

    Could you tell me please what is a reason of my problem? Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘comment_form() does not work (doesn't appear)’ is closed to new replies.