Help with Wordpress Template...

Cindy

Power Member
Joined
Apr 7, 2008
Messages
632
Reaction score
89
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!
 
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.
 
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.
 
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!
 
"No Comments
No comments yet.

RSS feed for comments on this post. TrackBack URL

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

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.
 

Attachments

Wow, Thank you Thank you Thank you! You Rock!
 
Back
Top