wordpress固定分类法的永久链接

时间:2013-04-24 13:33:31

标签: wordpress permalinks custom-taxonomy

我在wordpress中使用部落事件并且一直在努力解决以下问题:

我有按类别过滤的事件(自定义帖子类型)(此插件的默认分类)。 我正在使用“非常永久链接设置”,所以我的网址看起来像这样: [website.com] / events / category / Amsterdam /(当我的类别是阿姆斯特丹时)。

现在问题是: 我通过名为“event_type”的另一个自定义分类法(音乐会,发布...)对我的帖子进行了子过滤 当我试图从阿姆斯特丹获得所有“音乐会”类型的帖子时,我的网址是: [website.com] /活动/类别/阿姆斯特丹/?EVENT_TYPE =音乐会 在默认永久链接设置上,网址为: [website.com] /index.php?tribe_events_cat=amsterdam&event_type=concert

如何让WordPress转换并识别我的网址为: [website.com] /活动/类别/阿姆斯特丹/ EVENT_TYPE /音乐会/

我知道它与rewrite_rules_array有关但却无法做到。 任何帮助将非常感谢!

提前完成。

1 个答案:

答案 0 :(得分:0)

当您注册自定义帖子类型时:

function people_init() {
    // create a new taxonomy
    register_taxonomy(
        'people',
        'post',
        array(
            'label' => __( 'People' ),
            'rewrite' => array( 'slug' => 'person' ),
            'capabilities' => array(
                'assign_terms' => 'edit_guides',
                'edit_terms' => 'publish_guides'
            )
        )
    );
}
add_action( 'init', 'people_init' );

结帐“重写”参数。更多你可以在这里查看: http://codex.wordpress.org/Function_Reference/register_taxonomy

有时你需要通过转换永久链接设置并单击保存来刷新永久链接结构(不要问我为什么);)。