Many times we’ve been involved in a similar situation:
– someuser – “I don’t want people to comment my post, but I cannot figure out which part of the code I should strip out, could you help me?”
– twobeers – “NO!”
Ok, ok, I’m joking 😀
Actually there’s no need to modify theme’s or WP’s files to disable (and enable), comments or trackbacks/pingbacks.
- Allow link notifications from other blogs (pingbacks and trackbacks)
- Allow people to post comments on new articles
Doing this will disable Discussion by default for new posts, although it should be enabled again in single post (2). In previously published posts, discussion will be still enabled as this operation wont affect them, and their should be fixed one by one (2).
(2) When adding a new post (or modifying an existing one), check if “Discussion box” is available on the screen; If not, open Screen Options box, usually founded in the upper right corner of the screen (near Help), and check Discussion.
In Discussion box, uncheck (or check):
- Allow comments
- Allow trackbacks and pingbacks on this page
Now discussion is closed (opened), for the single post.
That’s all for now
( Cheers )