归档php文件应如何命名?
Url:
我的页面。com/gallerycategory/运动/
gallerycategory
- 自定义post类型的自定义分类的slug(自定义分类的名称为gallery_categories
带sluggallerycategory
)
\'sport\'
- 术语(类别)之一gallerycategory
.
当前点击此页面archive.php
文件,但我需要为此模式创建特定文件(“gallerycategory”/“customtaxonomyterm”)。
以下是我的注册方式:
$labels = array(
\'name\' => __(\'VmGallery\', THEME_TEXT_DOMAIN, THEME_TEXT_DOMAIN),
\'singular_name\' => __(\'VmGallery\', THEME_TEXT_DOMAIN),
...
);
$supports = array(\'title\', \'editor\', \'thumbnail\', \'excerpt\' ...);
$args = array(
\'labels\' => $labels,
\'description\' => \'VM galleries\',
\'public\' => true,
\'supports\' => $supports,
\'taxonomies\' => array(\'gallery_categories\', \'post_tag\'),
\'has_archive\' => \'gallery\'
);
register_post_type(\'vmgallery\', $args);
register_taxonomy(
\'gallery_categories\', \'VmGallery\', array(
\'hierarchical\' => true,
\'label\' => __(\'Categories\', THEME_TEXT_DOMAIN),
\'query_var\' => true,
\'rewrite\' => array(
\'slug\' => \'gallerycategory\',
\'with_front\' => false
),
)