首页 文章

如何自定义wordpress类别页面

提问于
浏览
0

我正在使用wordpress网站 . 我使用了创世纪主题 . 我为这个网站创建了自定义帖子类型和自定义分类 . 还为这个帖子类型创建了一些类别 . 我想自定义类别页面,即http://example.com/taxonomy-slug/category-name . 有谁知道请告诉我自定义类别页面需要做哪些更改 .

1 回答

  • 0

    "taxonomy--.php – If the taxonomy is sometax, and taxonomy’s term is someterm, WordPress will look for taxonomy-sometax-someterm.php. In the case of post formats, the taxonomy is ‘post_format’ and the terms are ‘post-format-. i.e. taxonomy-post_format-post-format-link.php for the link post format. taxonomy-.php – If the taxonomy were sometax, WordPress would look for taxonomy-sometax.php."来源https://developer.wordpress.org/themes/basics/template-hierarchy/

    因此,如果你有自定义分类法与slug“color”并且使用名称为“red”的术语,你只需创建taxonomy-color-red.php .

相关问题