最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Wordpress Custom Post Type Permalinks dynamic term slugs

programmeradmin0浏览0评论

I have a custom post type registered called Resource:

$args = array(
    'public' => true,
    'publicly_queryable' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'supports' => array('title', 'thumbnail'),
    'register_meta_box_cb' => null,
    'taxonomies' => array(),
    'has_archive' => false,
    'rewrite' => array('slug' =>    'resources'),
    //'rewrite' => array('slug' =>    'resources/%term%'),
    //'cptp_permalink_structure' => '%term%',
    'query_var' => true,
    'can_export' => true
);
register_post_type('resource', $args);

I have these sub-categories under Resource:

Name         Slug
---------------------
eBooks       ebook
Brochures    brochure
Podcasts     podcasts

My question is, the post under Resource will have permalink like:


I want to change the url structure to become:




I use the plugin Custom Post Type Permalinks, in the setting page, I confuse how to use the %slug% before /%postname%, so that the permalink will looks like above samples

I need someone to guide me how can I achieve this.

Thanks.

发布评论

评论列表(0)

  1. 暂无评论