WordPress Custom Post Type Permalinks dynamic term slugs
Question
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:
http://myurl.com/resources/post-name-1
I want to change the url structure to become:
http://myurl.com/resources/ebook/post-name-1
http://myurl.com/resources/brochure/post-name-2
http://myurl.com/resources/podcasts/post-name-3
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
custom-post-types, permalinks
7 months
0 Answers
91 views
0
Leave an answer
You must login or register to add a new answer .