[wp-hackers] Disable feedback for pages option

Stephen Rider wp-hackers at striderweb.com
Wed Jun 27 13:58:11 GMT 2007


Using the method below, the comments page is either present or  
entirely gone, as distinct from whether it is enabled or not.


On Jun 26, 2007, at 10:10 AM, Stephen Rider wrote:

> The custom field allows you to turn comments ON for a particular  
> page.  Basically the page.php code has a bit in there that says, if  
> CustomFieldX is present, show the comments form.
> So... by default, no comments on pages.  If you want comments on a  
> particular page, add the custom field to that page.
> I use it -- my WordPress plugin is on a page (less transient than a  
> blog post), and gets comments.  Other pages don't need comments,  
> and don't have them.
> Here's the code:
> <?php if ( get_post_custom_values('comments') ) comments_template 
> () // Add a key+value of "comments" to enable comments on this page ?>

More information about the wp-hackers mailing list