2011-10-01 70 views
0

是否有可能在wordpress中顯示自定義帖子類型的評論和評論形式,以及如何做到這一點?自定義文章類型和評論在wordpress

在此先感謝。

+1

可能重複 - WordPress的](http://stackoverflow.com/questions/7604206/comments-not-showing-in-custom-post-type-wordpress) – mercator

回答

0

這就是你把這個屬性在這一行「意見」非常重要的是:在你的functions.php文件

'supports' => array('title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail', 'revisions', 'author', 'page-attributes'), 

// register post type MySpecialPost 
add_action('init', 'register_cpt_MySpecialPost'); 
function register_cpt_MySpecialPost() { 
    $labels = array( 
     'name' => _x('MySpecialPost', 'MySpecialPost'), 
     'singular_name' => _x('MySpecialPost', 'MySpecialPost'), 
     'add_new' => _x('Ajouter', 'MySpecialPost'), 
     'add_new_item' => _x('Ajouter une MySpecialPost', 'MySpecialPost'), 
     'edit_item' => _x('Modifier', 'MySpecialPost'), 
     'new_item' => _x('Nouvelle MySpecialPost', 'MySpecialPost'), 
     'view_item' => _x('Voir la MySpecialPost', 'MySpecialPost'), 
     'search_items' => _x('Recherche', 'MySpecialPost'), 
     'not_found' => _x('Aucune MySpecialPost trouvé', 'MySpecialPost'), 
     'not_found_in_trash' => _x('Aucune MySpecialPost trouvé', 'MySpecialPost'), 
     'parent_item_colon' => _x('Parent Service:', 'MySpecialPost'), 
     'menu_name' => _x('MySpecialPost', 'MySpecialPost'), 
    ); 

    $args = array( 
     'labels' => $labels, 
     'hierarchical' => false, 
     'supports' => array('title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail', 'revisions', 'author', 'page-attributes'), 
     'public' => true, 
     'show_ui' => true, 
     'show_in_menu' => true, 
     'menu_position' => 21, 
     'show_in_nav_menus' => true, 
     'publicly_queryable' => true, 
     'exclude_from_search' => false, 
     'has_archive' => true, 
     'query_var' => true, 
     'can_export' => true, 
     'rewrite' => true, 
     'capability_type' => 'page' 
    ); 
    register_post_type('MySpecialPost', $args); 
} 
的[評論不是在自定義後類型顯示