Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/245.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 自定义帖子类型类别子页面_Php_Html_Wordpress_Content Management System_Custom Post Type - Fatal编程技术网

Php 自定义帖子类型类别子页面

Php 自定义帖子类型类别子页面,php,html,wordpress,content-management-system,custom-post-type,Php,Html,Wordpress,Content Management System,Custom Post Type,好的,我已经创建了一个新的自定义帖子类型,命名为sectors,并为此创建了一个子类别,命名为categories add_action( 'init', 'create_sector_cat' ); function create_sector_cat() { register_taxonomy( 'SectorCategories', 'sectors', array( 'label' => __

好的,我已经创建了一个新的自定义帖子类型,命名为sectors,并为此创建了一个子类别,命名为categories

    add_action( 'init', 'create_sector_cat' );

function create_sector_cat() {
    register_taxonomy(
        'SectorCategories',
        'sectors',
        array(
            'label' => __( 'Sector Categories' ),
            'rewrite' => array( 'slug' => 'sectorcategories' ),
            'hierarchical' => true,
        )
    );
}

现在,当我按下sector categories时,它会显示使用名为sectorcategories.php的文件创建的所有类别


然后,我会在这个类别中有不同的“产品”,我知道文件名应该是taxonomy-sectorcategories.php,但这个文件不工作?

第一个参数是分类名称。根据Wordpress法典,它应该只包含小写字母和下划线字符

我看到你的分类名称中有一个大写字母,这可能就是问题所在。我可能错了,但我也遇到了麻烦,我认为它非常区分大小写


ps:我知道这个答案来得晚,但如果它起作用,它可能仍然会帮助其他人。

有人吗?我不明白为什么找不到页面,我也查看了分类图!耐心点,你的帖子只被浏览了9次(在我发表评论时),而且是7小时前发布的。就我个人而言,我试图帮助你,但很难理解(至少对我来说)你到底在问什么。别担心,也许有人能完全理解它,并能回答它。