• Hello,
    I was wondering if there is a way to customize the twenty twelve theme to show the comments box blow my post within the home page. For some reason, the comment box is now showing up under my post(story) when displayed on the home page of url. But when you click on the post from the navigation link on the right, you can see the comment box below.

    How can i make it so that the comment box is showing on the bottom also from the home page?

    My goal is to make the home page Not static so that each post i add will just update with the one, but allow commenting on the bottom.

    *Note, i have already enabled comments via discussion settings.
    Thanks! Ben

Viewing 1 replies (of 1 total)
  • I’ve been struggling with this and I think I have finally got it to work, as follows. In the file index.php there are several loops and if..endif sections. You have to get it right, since only part of the code runs. The two lines of comment code have to be in the first part of the if loop. Here’s what I did:

    <?php if ( have_posts() ) : ?>
    
    			<?php /* Start the Loop */ ?>
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', get_post_format() ); ?>
    			<?php $withcomments = 1 ?>
    			<?php comments_template( '', true ); ?>
    			<?php endwhile; ?>
    			<?php twentytwelve_content_nav( 'nav-below' ); ?>
    
    		<?php else : ?>

    The comments code goes within the while...endwhile loop, just before the endwhile, so it shows up under each post. There are two lines: $withcomments = 1 This variable seems to need to be set to 1 first, then the function called comments_template( '', true );

    And that seems to work.

Viewing 1 replies (of 1 total)
  • The topic ‘How to show comments in Twenty Twelve Theme home page’ is closed to new replies.