Wordpress 自定义帖子类型帖子未显示在edit.php中
我的自定义帖子类型帖子在我的WordPress管理站点的edit.php页面中根本不显示: wp admin/edit.php?post\u type=my\u custom\u post\u type 但是,页面顶部显示了自定义帖子类型的正确计数:Wordpress 自定义帖子类型帖子未显示在edit.php中,wordpress,Wordpress,我的自定义帖子类型帖子在我的WordPress管理站点的edit.php页面中根本不显示: wp admin/edit.php?post\u type=my\u custom\u post\u type 但是,页面顶部显示了自定义帖子类型的正确计数: All (3) | Published (2) | Draft (1) 3 items “添加新链接”也可以工作,我可以创建这种类型的新自定义帖子类型,但当我将其保存为草稿或发布时,它不会显示在列表中。计数值将递增,就好像WordPre
All (3) | Published (2) | Draft (1) 3 items
“添加新链接”也可以工作,我可以创建这种类型的新自定义帖子类型,但当我将其保存为草稿或发布时,它不会显示在列表中。计数值将递增,就好像WordPress知道文章已发布,但它不会显示在edit.php列表中
以前有人见过这种现象吗?有人知道是什么变化导致了这种情况吗?它以前工作得很好。要为自定义帖子类型添加编辑,您可以使用 “public”=>正确 “公开可查询”=>正确 要删除自定义帖子类型的编辑,您可以使用 “public”=>false “公开可查询”=>错误 *这是不允许自定义帖子类型的帖子编辑页面*
register_post_type( 'address',
array(
'labels' => array(
'name' => 'Address',
'singular_name' => 'Address',
'add_new' => 'Add New',
'add_new_item' => 'Add New Address',
'edit_item' => 'Edit Address',
'new_item' => 'New Address',
'view_item' => 'View Address',
'search_items' => 'Search Address',
'not_found' => 'Nothing Found',
'not_found_in_trash' => 'Nothing found in the Trash',
'parent_item_colon' => ''
),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail')
)
);
要为自定义帖子类型添加编辑,您可以使用 “public”=>正确 “公开可查询”=>正确 要删除自定义帖子类型的编辑,您可以使用 “public”=>false “公开可查询”=>错误 *这是不允许自定义帖子类型的帖子编辑页面*
register_post_type( 'address',
array(
'labels' => array(
'name' => 'Address',
'singular_name' => 'Address',
'add_new' => 'Add New',
'add_new_item' => 'Add New Address',
'edit_item' => 'Edit Address',
'new_item' => 'New Address',
'view_item' => 'View Address',
'search_items' => 'Search Address',
'not_found' => 'Nothing Found',
'not_found_in_trash' => 'Nothing found in the Trash',
'parent_item_colon' => ''
),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail')
)
);
我也有同样的问题。functions.php文件中有一个函数导致了该问题。我在functions.php中修改了主查询,但没有注意管理端的效果。 因此,在您修改主查询的地方,您需要使用
!is_admin()
我也有同样的问题。functions.php文件中有一个函数导致了该问题。我在functions.php中修改了主查询,但没有注意管理端的效果。 因此,在您修改主查询的地方,您需要使用
!is_admin()
您是否已打开调试?有php错误或控制台错误吗?是否已打开调试?有php错误或控制台错误吗?