Forums

[resolved] Disable comments throughout the blog? (4 posts)

  1. M.K.
    Member
    Posted 3 years ago #

    People are asking for jobs in my Dubai Employment Help site! I have the forum for these kinds of questions, so until my visitors learn to use the forum, how can I disable comments in the blog?

    Thanks,

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    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.

  3. M.K.
    Member
    Posted 3 years ago #

    Thanks,

  4. Zoinks! Graphics
    Member
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.