post-type custom permalink rewrite
-
i want to edit post type link to be like this:
site.com/news/entry-post-title
witch “entry-” as static prefix before post title of posts of the post type “news”
i tried to use this:
function wptuts_custom_tags() { add_rewrite_rule("news/entry-([^/]+)(/[0-9]+)?", 'index.php?post_type=news&news=$matches[1]&name=$matches[2]','top'); } add_action('init','wptuts_custom_tags');
it works when i add “entry-” to links manually, but the perma link doesn’t echo the new structure , it echo the basic structure
site.com/news/post-title
how to make permalink echo the desired structure?
(note: posttype registered by plugin “types”)
Thanks
[ Please do not bump, that’s not permitted here. ]
- The topic ‘post-type custom permalink rewrite’ is closed to new replies.