admin管理员组

文章数量:1023195

For the Permalink on wordpress setting I have

/%category%/%postname%/

This will show Post in different category like /blog/post_title_1/ or /event/post_title_1/

but now I have some Custom Post type such as Photo Gallery with the postype = photo-gallery and this no longer works and gives a 404 page. I want to stick to the normal archive template of archive-photo-gallery.php as the default template to pull instead of trying to create a page template for this. how do I tell wordpress to be show the custom post type url like how it used to show up when you have /%postname%/ in permalink setting?

For the Permalink on wordpress setting I have

/%category%/%postname%/

This will show Post in different category like /blog/post_title_1/ or /event/post_title_1/

but now I have some Custom Post type such as Photo Gallery with the postype = photo-gallery and this no longer works and gives a 404 page. I want to stick to the normal archive template of archive-photo-gallery.php as the default template to pull instead of trying to create a page template for this. how do I tell wordpress to be show the custom post type url like how it used to show up when you have /%postname%/ in permalink setting?

Share Improve this question asked Jun 8, 2015 at 13:22 vicovico 1014 bronze badges 2
  • Have you refreshed/flushed the permalinks since adding the CPT? Try hitting Admin > Settings > Permalinks page (no need to change or save - loading the page is enough) to see if this solves your 404. – jdm2112 Commented Jun 8, 2015 at 14:27
  • does not seem to work. it no longer matches the custom post type slug it seems. – vico Commented Jun 8, 2015 at 14:37
Add a comment  | 

1 Answer 1

Reset to default 0

Permalink settings on WordPress only affect posts of the type "post". Not custom types. For this you'll need to write a plugin or find one.

For the Permalink on wordpress setting I have

/%category%/%postname%/

This will show Post in different category like /blog/post_title_1/ or /event/post_title_1/

but now I have some Custom Post type such as Photo Gallery with the postype = photo-gallery and this no longer works and gives a 404 page. I want to stick to the normal archive template of archive-photo-gallery.php as the default template to pull instead of trying to create a page template for this. how do I tell wordpress to be show the custom post type url like how it used to show up when you have /%postname%/ in permalink setting?

For the Permalink on wordpress setting I have

/%category%/%postname%/

This will show Post in different category like /blog/post_title_1/ or /event/post_title_1/

but now I have some Custom Post type such as Photo Gallery with the postype = photo-gallery and this no longer works and gives a 404 page. I want to stick to the normal archive template of archive-photo-gallery.php as the default template to pull instead of trying to create a page template for this. how do I tell wordpress to be show the custom post type url like how it used to show up when you have /%postname%/ in permalink setting?

Share Improve this question asked Jun 8, 2015 at 13:22 vicovico 1014 bronze badges 2
  • Have you refreshed/flushed the permalinks since adding the CPT? Try hitting Admin > Settings > Permalinks page (no need to change or save - loading the page is enough) to see if this solves your 404. – jdm2112 Commented Jun 8, 2015 at 14:27
  • does not seem to work. it no longer matches the custom post type slug it seems. – vico Commented Jun 8, 2015 at 14:37
Add a comment  | 

1 Answer 1

Reset to default 0

Permalink settings on WordPress only affect posts of the type "post". Not custom types. For this you'll need to write a plugin or find one.

本文标签: Wordpress Permalink Custom Post type