WordPress.org

Ready to get started?Download WordPress

Forums

TPG Get Posts
[resolved] Removal of Comment Box from static page in 20-10 (5 posts)

  1. nkdawe
    Member
    Posted 1 year ago #

    In Twenty-ten (stock) theme, I have tried to comment out the PHP code

    <?php comments_template( '', true ); ?>

    in

    loop.php
    loop-page.php, and
    loop-single.php

    However, the comments box continues to appear on my static home page. Under Discussion, both items (comments and pingbacks) are unchecked.

    Has anyone figured a way to remove the comments box on a static home page in the Twenty-ten theme while using TPG Get Posts?

    Thanks!

    http://wordpress.org/extend/plugins/tpg-get-posts/

  2. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    This has been discussed in this link and I have not been able to reproduce the problem on my site using twenty-ten. But I have turned off comments in general (setting >> discussion) and then enable on post where discussion is allowed.

    Hope that helps.

  3. nkdawe
    Member
    Posted 1 year ago #

    Thanks but I can assure you that the problem is real, at least on my site.

    At any rate, I did find a solution, which appears to be working.

    I added the following to the WP CSS file in my twenty-ten child directory:

    /* Remove comment box from static home page */

    body.page #comments {display:none;}

  4. cswaim
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the follow-up on the solution. This is a nagging problem that seems to appear randomly. Hopefully, a pattern will emerge and a solution can be found. Posting your solution will help in getting this resolved.

  5. nkdawe
    Member
    Posted 1 year ago #

    Here's a better solution to this problem:

    If you want to remove the comment box on a specific page, such as a static home page, look up the page-id in the <body> statement of the page you want to modify - (View Page Source).

    Then simply add the following code to your css file (in the child directory, of course):

    /* Remove comment box from static home page */

    .page-id-251 #comments {display:none;}

    This will remove the Comments box only from the page whose class id is 251 (Your page number will be different). My first solution (above) removed the comments box from every page, which is not what I wanted.

    Thanks to Geert at WordPress Answers (http://wordpress.stackexchange.com/users/4936/geert) for this.

    This method can be used to change styles for one page, alone.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic