• Resolved robin99134

    (@robin99134)


    Hello,
    I can show full posts on my homepage by using customizer -> Blog Settings -> Full Content
    But the comments are not shown with the posts on the homepage.Please tell me the neccessary edits to do to be able to show comments with the comment box on homepage.Please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Iceable

    (@iceable)

    Hello, it looks like you posted this question both here and on our own forums where I just replied ( https://www.iceablethemes.com/forums/topic/how-to-show-comments-on-homepage-under-each-posts/ )

    I’m posting a copy of the reply here for convenience, but let’s stick to only one thread for any further question!

    =====

    This theme does not natively support displaying comments for each post on the homepage, the comment section is only displayed on each individual post page.

    To customize the theme and add this functionality it is advised to first create a child theme (you could edit the theme’s file directly but this is not recommended since your changes would be lost after each update).

    Then copy the theme’s index.php file into your child theme, this is the file you are going to edit.

    In your child theme’s copy of index.php, find this line:

    ?></div><?php // end div post

    And just below add this code to insert the comment section below each post:

    // Display comments section only if comments are open or if there are comments already.
    	if ( comments_open() || get_comments_number()!=0 ):
    		?><div class="comments"><?php
    			comments_template( '', true );
    		?></div><?php // end comment section

    And this is it basically, it should do the trick!

    Theme Author Iceable

    (@iceable)

    Update: it seems like it is too late to edit my reply so I’ll add this here. One line was missing at the end of the code above, here it is again:

    // Display comments section only if comments are open or if there are comments already.
    	if ( comments_open() || get_comments_number()!=0 ):
    		?><div class="comments"><?php
    			comments_template( '', true );
    		?></div><?php // end comment section
    	endif;
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to show comments on homepage?’ is closed to new replies.