【问题标题】:cant get custom taxonomy urls to work in Wordpress无法让自定义分类法网址在 Wordpress 中工作
【发布时间】:2011-05-22 04:30:33
【问题描述】:

正如标题所说,

我尝试在 wordpress 中实现自定义分类法,我按照教程http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/ 的字母进行操作,我添加分类法的代码是(将其放置在插件以及模板函数 php.to no有用):

add_action( 'init', 'build_taxonomies', 0 );  

function build_taxonomies() {  
    register_taxonomy( 'operating_system', 'post', array( 'hierarchical' => true, 'label' => 'Operating System', 'query_var' => true, 'rewrite' => true ) );  
}  

之后,我可以向该分类法添加术语,并为帖子选择它们,一切都很好,但无论我尝试什么,我都无法获得“标记”帖子的列表,请自行查看:

http://sandbox.lautr.com/hello-world-2

这里的新术语是操作系统:-> 操作系统

是的,模板有一个 taxonomy.php,但它看起来根本没有调用它......我真的看不出我做错了什么,我使用的是 Wordpress 版本 3.0.2

编辑:

好的,我发现了我的错误,无论永久链接下的任何晦涩的原因类别基础都必须设置为 something,即使它只是默认值!

【问题讨论】:

    标签: php wordpress taxonomy


    【解决方案1】:

    好的,我发现了我的错误,无论永久链接下的任何晦涩的原因类别库都必须设置为某个值,即使它只是默认值!

    【讨论】:

    • @TheDeadMedic 嗯,是的,你知道你必须等待 2 天才能做到这一点,对吧?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-18
    • 2017-03-25
    相关资源
    最近更新 更多