WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] Remove commenting ability from new custom post type (7 posts)

  1. iwildeachit
    Member
    Posted 2 years ago #

    I am using Custom Post Type UI in conjunction with Formidable Pro to build a Help Desk Ticket System.

    I need to keep the ability for my regular users to be able to leave comments on regular post types in my WordPress site, but remove the 'Leave a Reply' commenting ability from the page template.

    Any ideas on how this is done?

    http://wordpress.org/extend/plugins/custom-post-type-ui/

  2. Ov3rfly
    Member
    Posted 2 years ago #

    Are you looking for something like this?

    Custom Post Type UI -> Manage Custom Post Types -> Edit (your custom type) -> Advanced Options -> Uncheck "Supports: Comments"

  3. iwildeachit
    Member
    Posted 2 years ago #

    I have done that, but my reply box still shows up on my site. It is being read from my single.php site, being that my custom post type is still a post.

  4. Ov3rfly
    Member
    Posted 2 years ago #

    Copy file single.php to single-yourposttype.php and remove comments_template(); from file single-yourposttype.php

    See also http://codex.wordpress.org/Template_Hierarchy

  5. iwildeachit
    Member
    Posted 2 years ago #

    I have a Custom Post Type named 'Topic'. I created a template named single-topic.php and removed the necessary code. It didn't work.

    I created a template called single-post.php with no comment code and it successfully removed the comments.

    Any idea why it's not working for the custom post type?

  6. Ov3rfly
    Member
    Posted 2 years ago #

    With changes in single-post.php, the comment-part will be removed in all normal WordPress posts which have internal post type post.

    For custom post types the part of the filename needs to be the same as in: Custom Post Type UI -> Manage Custom Post Types -> Edit (your custom type) -> "Post Type Name"

    One possibility: Maybe your custom post type name is not topic but topics (plural)? Then your file has to be called single-topics.php.

    Second possibility: Your test-post is a normal WordPress post with normal post type post and not a post with custom post type topic.

  7. iwildeachit
    Member
    Posted 2 years ago #

    Got it. I had my form set to create the wrong custom post type. It was set to post instead of topic.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic