enable comments for custom post type

In wordpress we can create the custom post types. Now everybody is using custom post types in wordpress and need comments functionality for custom post types also. Custom post types are very important feature of wordpress. For enabling the comments for custom post type just use the following line.

enable comments for custom post type

'supports' => array('title','editor','author','thumbnail','excerpt','comments')

Following line will add the title, thumbnail, excerpt and comments functionality to your custom post type.

enable comments for custom post type

enable comments for custom post type

For more information use check my following code. I used following code in my functions.php file.

add_action('init', 'wordpress_themes');
 function wordpress_themes() {
 $wp_themes_args = array(
 'label' => __('Wordpress Themes'),
 'singular_label' => __('Wordpress Themes'),
 'public' => true,
 'show_ui' => true,
 'capability_type' => 'post',
 'hierarchical' => false,
 'rewrite' => true,
  'supports' => array('title','editor','author','thumbnail','excerpt','comments'),
           'taxonomies' => array('category', 'post_tag') // this is IMPORTANT

 );
 register_post_type('wordpress-themes',$wp_themes_args);
 }
4 Comments

Add a Comment

Your email address will not be published. Required fields are marked *