Single comment box on posts
-
Interesting scenario – I don’t think it’s been requested before. Are you after a comment form at the foot of the content in the main column rather than in the sidebar? If so, it’s not something that can’t be done via any of the plugin settings.
The “General Comments” page already has the comment form in the main column, so it shouldn’t be a lot of work to adapt the way that works for the CPTs which you want to exhibit this behaviour. I’d be happy to lend a hand if you fork the GitHub repo.
Cheers, Christian
It can be in the sidebar – we just don’t want to split it by paragraphs. There’s no built-in setting for that, is there?
I’ve tried pulling in comments_template without invoking the sidebar as such, but something there still isn’t loading correctly, even putting aside the “still split by paragraph” thing – better keep looking, I guess!
Nothing’s currently up in github but I can put it up if that’d help.
Okay, I think I’ve found a solution for you. In your CommentPress settings under “Post Types on which CommentPress Core is enabled” switch off the ‘post’ post type and save the settings. Then add the following to a plugin or the functions.php file of your child theme:
/** * Allow certain CPTs to be commentable, but not by paragraph. */ function my_override_commentable_status() { global $post; if ( $post->post_type == 'post' ) { add_filter( 'cp_is_commentable', '__return_true' ); } } // hook into 'wp' action after CommentPress add_action( 'wp', 'my_override_commentable_status', 20 );You should have a commentable post without paragraph-level commenting.
Thank you!
The topic ‘Single comment box on posts’ is closed to new replies.
(@rmaxfiel)
9 years, 3 months ago
Hello,
On our site, we have CommentPress operating for purposes of commenting on individual paragraphs on Pages, but we’d like to be able to include a generic single comment box on Posts. Is there a built-in way to do this already? I thought I’d check before trying to code something.
Thanks!