WordPress.org

Forums

Comments template not showing up in posts in wordpress (17 posts)

  1. ParamasivanPN
    Member
    Posted 1 year ago #

    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?

  2. esmi
    Forum Moderator
    Posted 1 year ago #

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

  3. ParamasivanPN
    Member
    Posted 1 year ago #

    It is wordpress default theme 2014.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    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.
    http://wordpress.org/themes/twentyfourteen

  5. ParamasivanPN
    Member
    Posted 1 year ago #

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

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    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.

  7. ParamasivanPN
    Member
    Posted 1 year ago #

    Any other solution?

  8. alchymyth
    Forum Moderator
    Posted 1 year ago #

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

  9. ParamasivanPN
    Member
    Posted 1 year ago #

    It is single.php

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

  10. alchymyth
    Forum Moderator
    Posted 1 year ago #

    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?

  11. ParamasivanPN
    Member
    Posted 1 year ago #

    <?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.]

  12. alchymyth
    Forum Moderator
    Posted 1 year ago #

    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?

  13. ParamasivanPN
    Member
    Posted 1 year ago #

    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.

  14. ParamasivanPN
    Member
    Posted 1 year ago #

    I deactivated all the plugins but still not showing up.

  15. alchymyth
    Forum Moderator
    Posted 1 year ago #

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

  16. ParamasivanPN
    Member
    Posted 1 year ago #

    I am sorry. It is not showing up.

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

  17. ParamasivanPN
    Member
    Posted 1 year ago #

    I have set the permalink as /%category%/%postname%/

    Is it because of that ? It is not showing up in default 2014 theme also.

Topic Closed

This topic has been closed to new replies.

About this Topic