Support » Fixing WordPress » Comments template not showing up in posts in wordpress

  • In the detail posts (games) such as http://alltimeplay.com/action/istunt-2/ I used comments template just below the “Did you like this game” Div (besides game description div). But comments template is not showing up. I created test page and in that comments template is showing up. I could not figure out why.

    <?php
    // Start the Loop.
    while ( have_posts() ) : the_post();
    
        if ( comments_open() || get_comments_number() ) {
            comments_template();
        }
    endwhile;
    ?>

    It is wordpress 3.9.1. Any help?

Viewing 15 replies - 1 through 15 (of 16 total)
  • esmi

    (@esmi)

    Forum Moderator

    What theme are you using? Where did you download it from?

    It is wordpress default theme 2014.

    esmi

    (@esmi)

    Forum Moderator

    Re-upload a fresh, unpacked, copy of the theme’s folder to wp-content/themes using FTP or whatever file management application your host provides.

    Twenty Fourteen

    I will lose all the customizations I have done so far.

    esmi

    (@esmi)

    Forum Moderator

    Do not edit the Twenty Fourteen theme. It is the current default WordPress theme and having access to an original, unedited, copy of the theme is vital in many situations. First create a child theme for your changes.

    Any other solution?

    Michael

    (@alchymyth)

    Forum Moderator

    what template file have you edited to include the code shown?

    It is single.php

    I marked as <?php comments_template(); ?> within the outer loop.

    Michael

    (@alchymyth)

    Forum Moderator

    there seems to be some comment form related code showing in the html of the linked post:

    <div id="comments" class="comments-area">
    
    </div><!-- #comments -->

    are you sure comments are enabeled for the post?

    what is the full code of single.php?

    <?php
    /**
     * The Template for displaying all single posts
     *
     * @package WordPress
     * @subpackage Twenty_Fourteen
     * @since Twenty Fourteen 1.0
     */
    
    get_header(); ?>
    
    	<div class="page-content">
             <div class="detailed-content">
                      <?php
    					while ( have_posts() ) : the_post(); ?>
                  <div class="detail-pad">
                                   <div class="breadcrumb">
                                        <?php if(function_exists('bcn_display'))
                                        {
                                         bcn_display();
                                        }?>
                                   </div>
    
                                   <div class="game-next">
                                      <div class="next-game">
                                        <img src="<?php bloginfo('template_url'); ?>/images/next-game-image.jpg" alt="next game"> <span>Next: <?php  next_post_link('%link');  ?></span>
                                      </div>
                                   </div>
    
                                   <div class="clearer"></div>
                                   <div class="extras">
                                        <div class="game-title"><h2><?php echo the_title(); ?></h2></div>
                                        <div class="favourite"><?php wpfp_link() ?></div>
                                        <div class="total-plays">Total Plays : <span><?php if(function_exists('the_views')) { the_views(); } ?></span> times</div>
                                   </div><!--  end extras  -->
    
                                   <div class="actual-game">
    
                                        <div class="play-wrapper">
    
                                             <div class="game-inside">
                                                 <div class="full-width2"><img src="<?php bloginfo('template_url'); ?>/images/full-width.png" alt=""></div>
    											 <?php the_content(); ?>
                                             </div>
                                        </div>
    
                                   </div>
    
                 </div>
    
                 <div class="tags-div"><?php the_tags(); ?></div>
    
                              <div class="share-focus">
                                   <div class="rate-share">
                                        <div class="rate-share-inner">
                                             <div class="success-msg" style="display:none;">
                                                  <span>Thank you, your vote was recorded and the game rating will be updated soon.</span>
                                             </div>
                                             <div class="user-likes">
                                                  <span>DID YOU LIKE THIS GAME?</span>
                                                  <a href="javascript:void(0);" class="btn-yes-no">Yes</a>
                                                  <a href="javascript:void(0);" class="btn-yes-no">No</a>
                                             </div>
    
                                             <div class="prog-bar">
                                                  <?php $likes = rand(900, 980) / 10;
    											        $dislikes = 100 - $likes;
    											  ?>
                                                  <div class="prog-div">
    											       <div class="div100">
                                                            <div class="prog-label">Yes  </div>
                                                            <div class="prog-actual"><?php echo do_shortcode('[rprogress value="'.$likes.'" color="#cc0001" border_radius="7px"]'); ?></div>
                                                       </div>
                                                       <div class="div100">
                                                            <div class="prog-label">No   </div>
                                                            <div class="prog-actual"><?php echo do_shortcode('[rprogress value="'.$dislikes.'" color="#2b2b2b" border_radius="7px"]'); ?></div>
                                                       </div>
                                                  </div>
                                                  <div class="prog-percent"><?php echo $likes; ?>%</div>
                                             </div>
                                        </div>
                                   </div>
    
                                   <div class="focus4">
                                        <a href="" class="btn-action" title="Remove distractions - Play in focus mode">Focus</a>
                                   </div>
                              </div>   <!--  end  share-focus  -->
    
                            <div class="share-and-inst">
                               <div class="share-outer">
                                 <div class="share-game">
    
    	<?php comments_template(); ?>
    
                                 </div>
                                </div>
    
                              <div class="game-inst">
                                   <?php the_field( "game_description" ); ?>
                              </div>
                           </div>   <!--  end  share-and-inst  -->
    
                             <?php endwhile;
    									?>
             </div><!--  end  detailed-content  -->
    
             <div class="detail-sidebar">
                  <?php get_sidebar( 'post' ); ?>
             </div>   <!--  end  detail-sidebar  -->
    
    	</div><!-- page-content -->
    
    <?php
    
    get_footer();

    [Moderator Note: Please post code or markup between backticks (not single quotes) or use the code button. Or better still – use a pastebin. Your posted code may now have been permanently damaged by the forum’s parser.]

    Michael

    (@alchymyth)

    Forum Moderator

    are comments enabled for the post?

    as already said, the ‘comments_template()’ seems to be called; however, the comment form is not output.

    have you made any edits to comments.php?

    does the problem persist if you temporarily disable all plugins?

    I have enabled comments for the post.

    In a page I made comments template and it is showing (deleted test page).

    I have not made any edits to comments.php

    I will try disable the plugins and see the result.

    I deactivated all the plugins but still not showing up.

    Michael

    (@alchymyth)

    Forum Moderator

    what happens if you temporarily switch to an unedited theme Twenty Fourteen – does the comment form show in the single post?

    I am sorry. It is not showing up.

    Currently mail() function is not working in the site. Is it because of that?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Comments template not showing up in posts in wordpress’ is closed to new replies.