首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在wordpress中为分类术语页面创建子页面?

如何在wordpress中为分类术语页面创建子页面?
EN

Stack Overflow用户
提问于 2020-12-27 21:47:04
回答 1查看 119关注 0票数 0

我已经创建了一个自定义分类以及术语页面的外观。

domain.com/taxonomy/term

但是对于每个分类法术语,我都包含了各种自定义字段和包含的内容。内容很大,我想把它们显示在有个别链接点击的子页面中。我想在子页面中显示它们。

例如:

domain.com/taxonomy/term/meta-data-1

domain.com/taxonomy/term/meta-data-2

我如何创建它?

我正在使用Genesis框架

EN

回答 1

Stack Overflow用户

发布于 2020-12-27 23:06:05

我假设你对php和Wordpress主题有一定的了解。

您可以创建/添加一个custom-subterm,然后为该custom-subterm创建一个名为taxonomy-custom-subterm.php的特定template

在内部,您可以向custom-term显示所有相关信息/元数据。

如果您的custom-taxonomy设置为hierachical (我相信这是默认行为),那么url应该是/custom-taxonomy/custom-term/custom-subterm/

图形化表示

代码语言:javascript
复制
domain.com/
  L custom-taxonomy/
    L custom-term/ (using taxonomy.php OR taxonomy-custom-term.php as template)
      L custom-subterm/ (using taxonomy-custom-subterm.php as template)

这是基于默认的Wordpress层次结构。

了解更多信息@ https://developer.wordpress.org/themes/basics/template-hierarchy/

和@ https://developer.wordpress.org/files/2014/10/Screenshot-2019-01-23-00.20.04.png

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65466415

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档