问题描述
我创建了一个名为 Portfolio 的自定义帖子类型。创建帖子类型后,我更新了永久链接。但是当我转到自定义帖子类型存档页面或单个页面时,它会显示 404 错误。
这是存档页面: https://dc1.justcreative.com/portfolio-item/
这是单页: https://dc1.justcreative.com/portfolio-item/primitive/
function jc_portfolio_post_type() {
$labels = array(
'name' => _x( 'Portfolio','Post Type General Name','jc' ),'singular_name' => _x( 'Portfolio','Post Type Singular Name','menu_name' => __( 'Portfolio','name_admin_bar' => __( 'Portfolio','archives' => __( 'Item Archives','attributes' => __( 'Item Attributes','parent_item_colon' => __( 'Parent Item:','all_items' => __( 'All Items','add_new_item' => __( 'Add New Item','add_new' => __( 'Add New','new_item' => __( 'New Item','edit_item' => __( 'Edit Item','update_item' => __( 'Update Item','view_item' => __( 'View Item','view_items' => __( 'View Items','search_items' => __( 'Search Item','not_found' => __( 'Not found','not_found_in_trash' => __( 'Not found in Trash','featured_image' => __( 'Featured Image','set_featured_image' => __( 'Set featured image','remove_featured_image' => __( 'Remove featured image','use_featured_image' => __( 'Use as featured image','insert_into_item' => __( 'Insert into item','uploaded_to_this_item' => __( 'Uploaded to this item','items_list' => __( 'Items list','items_list_navigation' => __( 'Items list navigation','filter_items_list' => __( 'Filter items list',);
$rewrite = array(
'slug' => 'portfolio-item','with_front' => true,'pages' => true,'Feeds' => true,);
$args = array(
'label' => __( 'Portfolio','description' => __( 'Post Type Description','labels' => $labels,'supports' => array( 'title','editor','thumbnail','revisions' ),'taxonomies' => array( 'portfolio_filter' ),'hierarchical' => false,'public' => true,'show_ui' => true,'show_in_menu' => true,'menu_position' => 5,'show_in_admin_bar' => true,'show_in_nav_menus' => true,'can_export' => true,'has_archive' => true,'exclude_from_search' => false,'publicly_queryable' => true,'rewrite' => $rewrite,'capability_type' => 'page',);
register_post_type( 'portfolio',$args );
}
add_action( 'init','jc_portfolio_post_type',0 );
有人告诉我如何解决这个问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)