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



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

domain.com/taxonomy/term

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

例如:

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

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

我该如何创建?

我正在使用Genesis Framework

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

您可以创建/添加一个custom-subterm,然后为该custom-subterm创建一个名为taxonomy-custom-subterm.php的特定template
在内部,您可以向custom-term显示所有相关信息/元数据。

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


图形表示

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

最新更新