Can anyone suggest how I can cleanly remove the comments section using the latest version of Thematic?
I want to remove the comment form as well as the "post a comment" link at the bottom of my posts.
Can anyone suggest how I can cleanly remove the comments section using the latest version of Thematic?
I want to remove the comment form as well as the "post a comment" link at the bottom of my posts.
you could disable comments on those posts. you might even be able to disable comments by default under the Discussion settings.
I didn't see any options to disable comments entirely.
I was hoping to modify the comments.php file to make my changes. I'm going to replace it with my own modules, but just am not sure what/where to modify in comments.php.
i just needed to do this and was dissatisfied w/ my own answer.
this worked for me to remove comments on Pages and on posts of type "portfolio". for some reason it didn't work when i hooked into 'init' so i went w/ template_redirect instead.
function remove_comments(){
if (is_page() OR ( get_post_type() == 'portfolio' ) ){
remove_action('thematic_comments_template','thematic_include_comments',5);
}
}
add_action('template_redirect','remove_comments');Thanks so much for this. I've been searching for how to do this using functions.php and now I know.
Anyway to turn off all thematic commenting functions sitewide? I don't want any comments anywhere or any mention of them within any of the post metas... Is there a global light switch?
thanks,
Derker
i'd try removing the conditionals i wrote above
function remove_comments(){
remove_action('thematic_comments_template','thematic_include_comments',5);
}
add_action('template_redirect','remove_comments');
untested, so your mileage may vary
Thanks, Helga!
This function worked for me!
Hi,
The easiest way to remove the comments template in a child theme is to create an empty comments.php file in your child theme. You'll want to set comments off in the discussion setting of the admin. The only problem is that the post meta on previously published posts will still say that comments are open. The only way to retroactively turn comments site wide without updating each post is via the database. Here's a great tutorial on how to deal with comments on the database level: http://digwp.com/2010/08/wordpress-sql-comments/
-Gene
Hi
I've just tried Helgstheviking's solution
function remove_comments(){
remove_action('thematic_comments_template','thematic_include_comments',5);
}
add_action('template_redirect','remove_comments');
but for me it fails.
I then tried the solution from em hr, here is the content of comments.php in my childtheme
<?php thematic_abovecomments() ?>
<div id="comments">
</div><!-- #comments -->
<?php thematic_belowcomments() ?>
but no joy here either!
In both instances, 'comments' were 'disallowed' in Settings > Discussions ad a new post added.
I've obviously done something silly but... ?
hi, if you want to remove comments from pages and allow then in posts, just look at thematic functions.php and you'll see:
// set comments handling for pages, archives and links
// If you set this to TRUE, comments only show up on pages with a key/value of "comments"
if (!defined('THEMATIC_COMPATIBLE_COMMENT_HANDLING')) {
define('THEMATIC_COMPATIBLE_COMMENT_HANDLING', false);
put this lines in your child, you only need to set true instead of false.
Salu2!
Thanks Helga, that function was almost what I needed. I modified it slightly as I needed the comments removed from posts in the category 'portfolio', rather than the post-type.
Below the function I used:
function remove_comments(){
if (is_page() OR in_category('portfolio') ){
remove_action('thematic_comments_template','thematic_include_comments',5);
}
}
add_action('template_redirect','remove_comments');This topic has been closed to new replies.