Ask your WordPress questions! Pay money and get answers fast! (more info)

Custom post type comments not working WordPress

  • SOLVED

I have 2 custom post types, both of which look like this (each one with it's own unique names obviously)



function create_reviews_post_type(){

register_post_type('review', array('labels'=>array('name'=>__('Reviews'),
'singular_name'=>__('Review'), 'add_new' => __('Add New'), 'add_new_item' => __('Add New Review'),
'edit' => __('Edit'), 'edit_item'=> __('Edit Review'), 'new_item' => __('New Review'),
'view' => __('View'), 'view_item' => __('View Review'), 'search_itmes' => __('Search Reviews'),
'not_found' => __('No reviews found'), 'not_found_in_trash' => __('No reviews found in Trash')), 'public'=> true , 'show_ui' => true, 'show_in_nav_menus'=>true, 'show_in_menu'=> true,
'query_var' => true, 'rewrite' => array('slug' => 'vps-review', 'with_front' => FALSE), 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments')));

}



As you can see I have comments enabled under the 'supports' array however visiting both of those custom post type pages results in:


Comments are closed.

Inside my single-review.php and single-video.php I have

<?php comments_template( '', true ); ?>


If I create a new post inside one of those custom post types, the comments form works, but it does not display or work on any existing posts that fall under one of those custom post types.

Answers (1)

2011-07-19

Navjot Singh answers:

Try running this SQL query

UPDATE wp_posts SET comment_status = 'open' WHERE post_type = 'review';

Change review to whatever post types you have.


Dan | gteh comments:

great thanks. that fixed it.