我正在一个配方网站上工作,它有一个自定义的帖子类型,recipes,以及两个用于处理配方类别和标签的自定义分类法。自定义帖子类型有效,类别的自定义分类也有效,即我可以访问单个帖子和类别页面。然而,当我尝试访问自定义分类标记页时,我得到了wordpress 404页。
我真的不知道如何解决这个问题,因为wordpress没有给我任何有用的错误代码。有什么建议吗?
我正在一个配方网站上工作,它有一个自定义的帖子类型,recipes,以及两个用于处理配方类别和标签的自定义分类法。自定义帖子类型有效,类别的自定义分类也有效,即我可以访问单个帖子和类别页面。然而,当我尝试访问自定义分类标记页时,我得到了wordpress 404页。
我真的不知道如何解决这个问题,因为wordpress没有给我任何有用的错误代码。有什么建议吗?
我也遇到过这个问题,两次,两个不同的错误,第一次我只是在wordpress选项中选择permalink结构并点击save,这是我的htaccess文件的问题,第二次是我注册slug的方式,
以下是一个完整的工作示例:
/* Post type : offre_emploi */
register_post_type(
"offre_emploi", /*Take this in note you\'ll need it*/
...
/* Register Taxonomy */
$labelsEmploisCat = array(
\'name\' => _x( \'Catégories\', \'post type general name\' ),
\'singular_name\' => _x( \'Catégorie\', \'post type singular name\' ),
\'add_new\' => _x( \'Ajouter une catégorie\', \'client\' ),
\'add_new_item\' => __( \'Ajouter une catégorie\' ),
\'edit_item\' => __( \'Modifier une catégorie\' ),
\'new_item\' => __( \'Modifier une catégorie\' ),
\'view_item\' => __( \'Voir une catégorie\' ),
\'search_items\' => __( \'Rechercher une catégorie\' ),
\'not_found\' => __( \'Aucune catégorie\' ),
\'not_found_in_trash\' => __( \'Aucune catégorie\' ),
\'parent_item_colon\' => \'\'
);
register_taxonomy(
"proprietaires_pieces",
array("offre_emploi"), //here goes the post type
array(
"hierarchical" => true,
"labels" => $labelsEmploisCat,
"rewrite" => true
)
);
希望对你有帮助关于自定义帖子类型/分类法,我遇到了404的奇怪问题。尝试在博客永久链接设置页面上再次点击保存。听起来很奇怪,我的问题解决了。