Support » Fixing WordPress » open comments box on my home page

  • Hi WordPress Team,

    When I start my website “ it starts on the home page. That’s fine. But I would like it to start with an open comment box at the bottom, so users don’t have to click to open it.
    At my “About” page it does start with an open comment box. Can this also
    be done on my home page?

    Thanks for your help in advance,

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi whitelight,

    It is possible to show a comments box on the homepage but it would show up after each and every article because it’s part of the WordPress Loop.

    Your homepage is slightly different because it isnt really a ‘page’ – it uses the WordPress Loop to show a list of the latest posts. Generally users would click on an article to read it more about it – and then they would be able to comment on it.

    The reason why the comment box is displayed on your About page is because it is a unique page, the same as a unique post.

    If you want to show the comments box after each article on the homepage, open your index.php file and look for the loop. It usually starts with:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    And ends with:

    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    Between these two you should look for:

    <?php the_content(); ?>

    Paste the following directly after this:

    <?php comment_form(); ?>

    Save and test. You should now see a comments box after each article on the homepage. If this wasn’t quite what you were looking for let me know – I’m just guessing 🙂

    Hi 2DMonkey,

    Thanks a lot for your help. It did work. But I would like to take out the 2 HTML tags and attribute lines between the comments box and the post comments press button. Also at the left side of the comment box
    I would like to take out the word comments and shift the box all the way to the left.

    Note: <?php the_content(); ?> In my index php it looks like this:
    <?php the_content(‘Read more »’); ?>

    I’ve 1 more q: At the top of the side bars on the left is this box: “RSS Subscribe Entries RSS | Comments RSS”. Since I already have the other 2 side bars for RSS and Email subscription, I’d like to take this one out too. At the widgets tab it doesn’t appear over there. Probably a part of the template itself.
    My site again:

    I hope I don’t ask to much,

    Thanks for your help in advance,

    Hi whitelight,

    I have downloaded the same template so I can see the files you are working with now.

    1. To amend the comments box on your homepage, you need to replace the code I suggested before:

    <?php comment_form(); ?>

    With the following:

    <?php include('comments_home.php'); ?>

    Then create a new file in your template directory called ‘comments_home.php’. Open it and paste in the following:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    The submit button should be on show because otherwise users cannot easily submit their comment – it also helps for accessibility.

    2. To remove the RSS subscribe links, open your sidebar.php file and remove all of the following:

    <div id="subscribe">
    		<h3 style="font-size: 150%;font-weight:100;"><img alt="RSS" src="<?php bloginfo('template_directory'); ?>/images/feed-icon-16x16.gif" /> Subscribe</h3>
    		<p><a href="<?php bloginfo_rss('rss2_url') ?>">Entries RSS</a> | <a href="<?php bloginfo_rss('comments_rss2_url') ?>">Comments RSS</a></p>

    Sorry for the long response. I hope that makes sense. If not, please respond.


    Hi 2DMonkey,

    Thanks for your reply. OK, I’ve got the upper side bar removed successfully. Then you advice me with:”create a new file in your template directory called ‘comments_home.php’.”
    I’m sorry but I’m new in this field. How do you make a new file in you template directory?

    Awaiting your answer,

    Hi Whitelight,

    To create a new file you will need a FTP client to access the files in your template – I would recommend FileZilla – setup instructions here.

    Or, follow these instructions to create a new theme file without FTP access.


    Thanks for your help. I still seem to have some problems. For now
    I just keep it the same as before and I’ll change it later on when I have
    a bit more knowledge of ftp.


Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘open comments box on my home page’ is closed to new replies.