如何制作标签分类页面?
How do I make a tag taxonomy page?
我有 woocommerce 插件。我在产品下创建了一个自定义标签分类法来挑选产品成分。 ( https://pasteboard.co/J2BlgqI.png ). To show them as buttons on the product page ( https://pasteboard.co/J2Bn7FD.jpg ).
现在我希望访问者在点击成分时向他们显示成分页面信息。所以,如果他们点击“Beeswax”,它会向他们显示 Beeswax 信息,例如名称、功能等……
每次我点击“Beeswax”时,它都会将我引导至一个过滤页面 https://pasteboard.co/J31hg2w.png。
如何为每种成分制作一个页面?
这样可行吗?还是有其他方法可以做到这一点?
请指教…
谢谢
是的,您可以为您的分类法设置自定义模板。 template hierarchy 说明了一切。
自定义分类法使用此模板文件路径:
taxonomy-{taxonomy}-{term}.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-{format}.
i.e. taxonomy-post_format-post-format-link.php for the link post
format.
taxonomy-{taxonomy}.php
– If the taxonomy were sometax, WordPress would look for taxonomy-sometax.php.
taxonomy.php
archive.php
index.php
由于您尚未创建 taxonomy-ingredients.php
WordPress 使用下一个可用选项并回退到通用模板。
您甚至可以使用上面的第一个选项为每个成分创建不同的模板(页面)。
我有 woocommerce 插件。我在产品下创建了一个自定义标签分类法来挑选产品成分。 ( https://pasteboard.co/J2BlgqI.png ). To show them as buttons on the product page ( https://pasteboard.co/J2Bn7FD.jpg ).
现在我希望访问者在点击成分时向他们显示成分页面信息。所以,如果他们点击“Beeswax”,它会向他们显示 Beeswax 信息,例如名称、功能等……
每次我点击“Beeswax”时,它都会将我引导至一个过滤页面 https://pasteboard.co/J31hg2w.png。
如何为每种成分制作一个页面?
这样可行吗?还是有其他方法可以做到这一点?
请指教…
谢谢
是的,您可以为您的分类法设置自定义模板。 template hierarchy 说明了一切。
自定义分类法使用此模板文件路径:
taxonomy-{taxonomy}-{term}.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-{format}. i.e. taxonomy-post_format-post-format-link.php for the link post format.taxonomy-{taxonomy}.php
– If the taxonomy were sometax, WordPress would look for taxonomy-sometax.php.taxonomy.php
archive.php
index.php
由于您尚未创建 taxonomy-ingredients.php
WordPress 使用下一个可用选项并回退到通用模板。
您甚至可以使用上面的第一个选项为每个成分创建不同的模板(页面)。