1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with Wordpress Template...

Discussion in 'Blogging' started by Cindy, Dec 17, 2008.

  1. Cindy

    Cindy Power Member

    Joined:
    Apr 7, 2008
    Messages:
    632
    Likes Received:
    88
    Hi, I just wondered if there's any way to get rid of comments (or the "no comments at this time" line) on wordpress PAGES but keep comments on wordpress POSTS? I deleted this line in the main index template (index.php) file:

    <?php comments_template(); // Get wp-comments.php template ?>

    But unfortunately it deletes comments in both?! I need to keep them in the posts but get rid of them on the pages.

    Thank you!
     
  2. Cindy

    Cindy Power Member

    Joined:
    Apr 7, 2008
    Messages:
    632
    Likes Received:
    88
    Also, I'm using wordpress classic theme
     
  3. yeti_racer

    yeti_racer Junior Member Premium Member

    Joined:
    Dec 3, 2008
    Messages:
    192
    Likes Received:
    87
    Location:
    Hick Ville
    There should be a separate template for your pages. Normally named page.php or something like that. It's the file you want to remove the comment logic from.
     
  4. gucci

    gucci BANNED BANNED

    Joined:
    Sep 21, 2008
    Messages:
    36
    Likes Received:
    62
    You can do this from the admin dashboard instead of playing with the template.
    Both in "write post" and "write page", you have under the advanced options the privilege to check/uncheck the "allow comments" checkbox.
     
  5. Cindy

    Cindy Power Member

    Joined:
    Apr 7, 2008
    Messages:
    632
    Likes Received:
    88
    yeti_racer said:

    "There should be a separate template for your pages. Normally named page.php or something like that. It's the file you want to remove the comment logic from. "

    Nope, my listing for theme files are the following:

    Header (header.php)
    Main Index Template (index.php)
    Comments (comments.php)
    Theme Functions (functions.php)
    Popup Comments (comments-popup.php)
    Sidebar (sidebar.php)
    Footer (footer.php)
    Styles
    Stylesheet (style.css)
    RTL Stylesheet (rtl.css)


    gucci said:

    "You can do this from the admin dashboard instead of playing with the template.
    Both in "write post" and "write page", you have under the advanced options the privilege to check/uncheck the "allow comments" checkbox. "

    The allow comments is already automatically unchecked on ALL my posts / pages. The pages currently have this at the bottom of every page:

    "No Comments
    No comments yet.

    RSS feed for comments on this post. TrackBack URL

    Sorry, the comment form is closed at this time."


    That is what I need automatically removed.

    Thank you!
     
  6. gucci

    gucci BANNED BANNED

    Joined:
    Sep 21, 2008
    Messages:
    36
    Likes Received:
    62
    If it is just those four lines you want to get rid off, then you have to sort of hack the comments.php file for the classic theme. I've done it for you and attached. Make sure you first back up your original file and then replace with the attached one.
     

    Attached Files:

    • Thanks Thanks x 1
  7. Cindy

    Cindy Power Member

    Joined:
    Apr 7, 2008
    Messages:
    632
    Likes Received:
    88
    Wow, Thank you Thank you Thank you! You Rock!