Suppressing comments on all pages except blog posts


Author Message
Kirk

Posted: 11/11/2009
Quote message 

I need to suppress the comments on all static pages but not the blog posting page.

Per an earliler post from Garry I have removed the code which gets the comments, date, author, categories from index.php, page.php and single.php. Here's the code I removed:

<?php comments_template(); ?>

And then I took the code in page.php (with the comment code still intact) and added the following code per other Forum posts at the top:

<?php
/*
Template Name: new template
*/
?>


Saved this new .php file with the name 2page.php and uploaded it via FileZilla. Created a page using the "new template" instead of the default template.

Lastly, went to Settings>>>Reading and designated this new page for blog post....and published....the comment ability does not appear.

This is driving me nuts...does anybody see what I'm doing wrong here?

I am grateful for support on this.



 
Bob

Posted: 11/12/2009
Quote message 

Here's what I do...

Make a copy of page.php and rename it page-comments.php

In the new file called page-comments.php I put the template code at the top

<?php
/*
Template Name: page with comments
*/
?>

and I leave the <?php comments_template(); ?> in.

In the original page.php I remove the

<?php comments_template(); ?>

and upload both files to my template directory overwriting the page.php and adding the new page-comments.php

So now my standard pages do not have comments but if I want a page to have them I use the "page with comments" template when I publish it

bare in mind the original page.php file does not need the template code at the top only the new "page with comments" template does.
 
Stephen

Posted: 12/22/2009
Quote message 

I have the opposite problem and can not get Comments to show up on pages - only Posts.

Checked every setting I can find and nothing.

It only happens on sites created with Artisteer, so wondering if the default is to suppress page comments?

 
Bud

Posted: 12/22/2009
Quote message 

They hadn't enabled comments on pages in older versions of Artisteer.

If you have an older version add this...

<?php comments_template(); ?>


Just before this...

<?php endwhile; endif; ?>


towards the bottom of your page.php file.

And make sure comments are enabled for the page in the page edit screen.

Bud
budstechshed.com
 
Stephen

Posted: 12/22/2009
Quote message 

Fantastic! Thank you!
 
Garry

Posted: 12/22/2009
Quote message 

In Artisteer 2.3 generated themes you can add comments to your pages also.
 
Adam the Horrible

Posted: 12/23/2009
Quote message 

I reckon that pretty soon you should be able to easily make such specifications in style.css in future versions of Artisteer. It can even be done now on Artisteer with some editing (not exactly simple, but not so hard).