【问题标题】:How to use categories in the URL with Advanced Custom Fields?如何将 URL 中的类别与高级自定义字段一起使用?
【发布时间】:2014-02-23 17:40:48
【问题描述】:

使用 advancedcustomfields.com 插件:

1)我想向 ACF 发帖并使用一个类别,就像普通博客帖子一样,但 URL 是:mysite.com/customPost/category/post-name

这可能吗?我该怎么做?

2)我可以为每个类别页面添加自定义页面模板吗?

谢谢!

【问题讨论】:

    标签: wordpress advanced-custom-fields


    【解决方案1】:

    1) 我不明白 ACF 在图片中的位置,对于类别和术语,您应该使用自定义分类法而不是 ACF。 Here is a link on how to do that.

    2) 是的。 worddpress 层次结构让您可以做到这一点。假设您有分类书籍,并且想要有不同的幻想和浪漫模板,您可以这样做

    taxonomy-books-romance.php
    taxonomy-books-fantasy.php
    

    它在层次结构中称为taxonomy-$taxonomy-$term.php。

    【讨论】:

    • +1 I dont understand where ACF gets in the picture .. 我不明白亚足联的人气从何而来:-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-30
    • 2019-10-09
    • 1970-01-01
    • 2015-07-31
    • 1970-01-01
    • 2017-08-28
    • 2013-11-25
    相关资源
    最近更新 更多