这是我注册帖子类型的代码:
// Register new post type, User Conversations: b2bking_conversation
add_action( \'init\', array($this, \'b2bking_register_post_type_conversation\'), 0 );
function b2bking_register_post_type_conversation() {
// Build labels and arguments
$labels = array(
\'name\' => __( \'Conversations\', \'b2bking\' ),
\'singular_name\' => __( \'Conversation\', \'b2bking\' ),
\'all_items\' => __( \'Conversations\', \'b2bking\' ),
\'menu_name\' => _x( \'Conversations\', \'Admin menu name\', \'b2bking\' ),
\'add_new\' => __( \'Start Conversation\', \'b2bking\' ),
\'add_new_item\' => __( \'Start new conversation\', \'b2bking\' ),
\'edit\' => __( \'Edit\', \'b2bking\' ),
\'edit_item\' => __( \'Edit conversation\', \'b2bking\' ),
\'new_item\' => __( \'New conversation\', \'b2bking\' ),
\'view_item\' => __( \'View conversation\', \'b2bking\' ),
\'view_items\' => __( \'View conversations\', \'b2bking\' ),
\'search_items\' => __( \'Search conversations\', \'b2bking\' ),
\'not_found\' => __( \'No conversations found\', \'b2bking\' ),
\'not_found_in_trash\' => __( \'No conversations found in trash\', \'b2bking\' ),
\'parent\' => __( \'Parent conversation\', \'b2bking\' ),
\'featured_image\' => __( \'Conversation image\', \'b2bking\' ),
\'set_featured_image\' => __( \'Set conversation image\', \'b2bking\' ),
\'remove_featured_image\' => __( \'Remove conversation image\', \'b2bking\' ),
\'use_featured_image\' => __( \'Use as conversation image\', \'b2bking\' ),
\'insert_into_item\' => __( \'Insert into conversation\', \'b2bking\' ),
\'uploaded_to_this_item\' => __( \'Uploaded to this conversation\', \'b2bking\' ),
\'filter_items_list\' => __( \'Filter conversations\', \'b2bking\' ),
\'items_list_navigation\' => __( \'Conversations navigation\', \'b2bking\' ),
\'items_list\' => __( \'Conversations list\', \'b2bking\' )
);
$args = array(
\'label\' => __( \'Conversation\', \'b2bking\' ),
\'description\' => __( \'This is where you can create new conversations\', \'b2bking\' ),
\'labels\' => $labels,
\'supports\' => array(\'title\',\'editor\',\'author\', \'comments\',\'thumbnail\'),
\'hierarchical\' => false,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'show_in_menu\' => \'b2bking\',
\'menu_position\' => 100,
\'show_in_admin_bar\' => true,
\'can_export\' => true,
\'has_archive\' => true,
\'exclude_from_search\' => false,
\'capability_type\' => \'post\',
\'rewrite\' => array("slug" => "conversations"),
);
// Actually register the post type
register_post_type( \'b2bking_conversation\', $args );
}
无论我做什么,我都无法查看这些帖子。该链接要么转到404或只能看到默认Hello World帖子的页面,要么重定向到首页。
我已经保存了永久链接,尝试了flush\\u rewrite\\u rules(),尝试了多个域。。。