0
votes

I'm trying to create a rewrite rule to pull postmeta into the permalink URL.

For example, my postmeta is for a specific list number (list_number) for a custom post type (tutorial). The list number is different for each custom post type.

I would like the permalink to be foo.com/[cpt_slug]/list_number/[tutorial title]

or foo.com/tutorials/23/how-to-add-cpt-permalink where "How to add CPT permalink" is #23 in the series, set in the post.

Can this be done?

1

1 Answers

0
votes

Yes, you can achieve this by

'rewrite' => array('slug' => 'list_number')

when you define your custom post type.

Refer this codex page for more information http://codex.wordpress.org/Post_Types