Viewing 3 replies - 1 through 3 (of 3 total)
  • For already published posts you need to uncheck the Allow Comments under the Comments & Pings section on each post.

    You also need uncheck the Allow people to post comments on the article via Administration > Settings > Discussion so that when creating posts in the future that Allow Comments box is automatically unchecked.

    Thread Starter M.K. Safi

    (@msafi)

    Thanks,

    I’ve seen a few requests for this type of solution during my own quest. Having just come up with an alternative to manually changing each post’s settings *or* editing the database, I figured I’d post it here for the benefit of others.

    In /wp-content/themes/YOURtheme/single.php replace all the if/elseif $post->comment_status and ‘open’==$post->ping_status with the following…

    if(('open'==$post->comment_status) &&
    	('open'==get_option('default_comment_status')))
    		{
    		echo ' You can follow any responses to this entry through the ';
    		post_comments_feed_link('RSS 2.0');  echo ' feed. ';
    
    		echo ' You can skip to the end and <a href="#respond">leave a response</a>. ';
    		}
    
    	if('open'==$post->ping_status)
    		{
    		echo ' You can <a href="';  trackback_url();
    		echo ' " rel="trackback">trackback</a> from your own site. ';
    		}

    Then change comments_template(); to…

    if('open'==get_option('default_comment_status'))
    		{ comments_template(); }

    The resultant potential repetition of “You can” verbiage isn’t as elegant as the the default text, but it solves the issue of being able to turn off comment display/commenting in ALL posts in one shot using the Administration > Settings > Discussion “Allow people to post comments on the article” button, overriding each post’s individual discussion settings.

    Hope this helps someone out there!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable comments throughout the blog?’ is closed to new replies.