[Resolved] Comment Box on Latest Posts Home Page

Home Forums Support [Resolved] Comment Box on Latest Posts Home Page

Home Forums Support Comment Box on Latest Posts Home Page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #225315
    Alisha

    I have a client who would like the comment box to appear below the blog posts on the home page (which is set for latest posts) instead of the “Leave a comment” link (that takes the person to the blog page).

    I know this can be done by customizing the PHP but I prefer not to create a child theme for a number of reasons.

    So, I tried creating a page that included a WP Show Posts shortcode for a listing of all blog posts and turning on comments for the page but there were two issues: 1) if there is more than one blog post, the comment page doesn’t appear until after all of the blog posts are listed and 2) when a comment is added, it links to the page; not the blog post (if you have just one showing).

    I also tried using <?php comment_form(); ?> in the ‘After Content’ GP Hooks which worked great but the comment box is duplicated when you go to the blog page.

    Any suggestions?

    Thank you! πŸ™‚

    #225357
    Tom
    Lead Developer
    Lead Developer

    You could set it to only happen on the front page in GP Hooks:

    <?php if ( is_front_page() ) {
        comment_form();
    } ?>

    That might be the best way to do it πŸ™‚

    #225404
    Alisha

    Thank you Tom – great suggestion. It fixed the duplication issue but it only adds a comment box to the first blog post on the home page (see demo site here: http://ripplerox.com/). Is there a way to add it to each blog post on the home page, regardless of the number or will he have to set his home page to just show one post?

    ps Love the new picture – adorable!

    #225450
    Tom
    Lead Developer
    Lead Developer

    This may be a limitation of the WordPress comment system – it’s built to display only once on the single post page, so it may not be possible to include it under each and every blog excerpt on the main posts page.

    Thank you! πŸ™‚

    #225565
    Alisha

    Ah. Gotcha. Thanks for the help – as always. πŸ™‚

    #225584
    Tom
    Lead Developer
    Lead Developer
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.