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.
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); }
thanks for sharing. is there a way that i could enable a plugin in custom post types? i wanted to use podpress but its settings are not available.
thanks!
Thanks for your comments.
Perfect – I had completely missed adding the comments into the string and wondered why they were showing up as closed. These new Post Types are brilliant but not a lot of info around on how to maximise them!
Just normal comments work, popup comments doesn’t work, it shows a same post page on popup window. You know why?
Thanks