ThemeShaper Forums » Thematic

[closed]

Removing comments section from Thematic

(12 posts)
  • Started 3 years ago by gnucom
  • Latest reply from SjoerdKoelewijn
  • This topic is resolved

Tags:

  1. 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.

    Posted 3 years ago #
  2. you could disable comments on those posts. you might even be able to disable comments by default under the Discussion settings.

    Posted 3 years ago #
  3. 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.

    Posted 3 years ago #
  4. 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');
    Posted 3 years ago #
  5. Thanks so much for this. I've been searching for how to do this using functions.php and now I know.

    Posted 3 years ago #
  6. NED
    Member

    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

    Posted 3 years ago #
  7. 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

    Posted 3 years ago #
  8. Thanks, Helga!
    This function worked for me!

    Posted 3 years ago #
  9. 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

    Posted 3 years ago #
  10. Jahdo
    Member

    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... ?

    Posted 3 years ago #
  11. 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!

    Posted 3 years ago #
  12. 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');
    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.