我几乎没有自定义的帖子类型,在单个帖子上我得到了404错误页面。我想我已经尝试了网上发布的几乎所有解决方案,但它仍然不适合我,我开始觉得我犯了一些其他的错误。当我尝试调试时,我发现我的每个自定义帖子都被解析为“附件”。请帮我弄清楚我犯了什么错误。
function jnj_register_board_members_posttype ()
{
$labels = array (
\'name\' => _x ( \'Board Members\' , \'jnj\' ) ,
\'singular_name\' => _x ( \'Board Member\' , \'jnj\' ) ,
\'add_new\' => _x ( \'New Member\' , \'jnj\' ) ,
\'add_new_item\' => __ ( \'New Board Member\' , \'jnj\' ) ,
\'edit_item\' => __ ( \'Edit\' , \'jnj\' ) ,
\'new_item\' => __ ( \'New Board Member \' ) ,
\'all_items\' => __ ( \'All Board Members\' ) ,
\'view_item\' => __ ( \'View Board Member\' ) ,
\'search_items\' => __ ( \'Search Board Members\' ) ,
\'not_found\' => __ ( \'No Board Members found\' ) ,
\'not_found_in_trash\' => __ ( \'Board Member not found in Trash\' ) ,
\'parent_item_colon\' => \'\' ,
\'menu_name\' => \'Board Member\' )
;
$args = array (
\'labels\' => $labels ,
\'public\' => true ,
\'publicly_queryable\' => true ,
\'show_ui\' => true ,
\'show_in_menu\' => true ,
\'query_var\' => true ,
\'rewrite\' => array( \'slug\' => \'board-members\', \'with_front\' => false),
\'capability_type\' => \'post\' ,
\'hierarchical\' => false ,
\'menu_position\' => 5 ,
\'menu_icon\' => get_stylesheet_directory_uri ( ) . \'/images/board-members.png\' ,
\'register_meta_box_cb\'=>\'register_board_members_metabox\',
\'taxonomies\' => array ( \'jnj_title\' ) ,
\'supports\' => array ( \'title\' , \'editor\' , \'thumbnail\' , \'custom-fields\' , \'excerpt\' ) )
;
register_post_type ( \'board_members\' , $args );
}
add_action(\'init\', \'jnj_register_board_members_posttype\');