ThemeShaper Forums » Thematic

[closed]

Comments on Pages

(4 posts)
  • Started 3 years ago by stever
  • Latest reply from stever
  • This topic is resolved

Tags:

  1. stever
    Member

    Hi Guys, new to Thematic, well done Ian this is a work of art.

    I have 0.9.7.7 Thematic installed, working very well. I can see from the page templates in Thematic they call for the comment template, and hence my child theme pages have comments. All the posts I have seen on the forum have been about page comments going missing, requiring the comment/comment custom field to enable them. In reverse how do I get rid of them for pages only, not posts?

    I can see that I could remove the call for the comments template in my child theme page templates, but is this the correct way to do it? Or have I missed something very simple here? Because that's happened before!

    Posted 3 years ago #
  2. i think this is what you are after:

    /* Remove Comments */
    function remove_comments(){
    if(is_page()){
    	remove_action('thematic_comments_template','thematic_include_comments',5);
    }
    }
    add_action('template_redirect','remove_comments');
    Posted 3 years ago #
  3. doing some more research on my own themes... i discovered you can kill the metabox bubbles for comments on the backend too... via remove_post_type_support

    /* Remove Comments */
    function remove_comments(){
    	if(is_page()){
    	remove_action('thematic_comments_template','thematic_include_comments',5);
    	}
    	remove_post_type_support( 'page', 'comments' ); //totally disable comments in backend
    }
    add_action('init','remove_comments');

    in my first reply i added the action to template_redirect. i often do that so i can get conditionals to work for is_page_template(), but to use remove_post_type support you have to add it to init

    Posted 3 years ago #
  4. stever
    Member

    Hi Helga, thank you for your help on this one. Tried both options, the latter one first but that didn't work for me. However the first option worked a treat, no comments. Is this normal to have comments on pages or have I missed something in the Docs?

    Can't thank you enough.
    Steve

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.