Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

I have a page title "more" with subpage "cities-guide". Said "cities guide" page has a loop that pulls in posts from custom post type "thailife_city_guide".

My permalink structure is /%category%/%postname%//%category%/%postname%/.

At present clicking a link to a custom post from www.mydomain.com/more/cities-guide gives "www.mydomain.com/thailife_city_guide/bangkok"
www.mydomain.com/more/cities-guide gives
www.mydomain.com/thailife_city_guide/bangkok for example.

I want it to be displayed as "www.mydomain.com/more/cities-guide/bangkok"www.mydomain.com/more/cities-guide/bangkok but cannot get anything to work

I tried fixing the rewrite in the CPT register to 'rewrite' => array( 'slug' => 'more/cities-guide' )'rewrite' => array( 'slug' => 'more/cities-guide' ), but to no avail, throws a 404.

Can someone please advise as I just dont really understand the way inwhich Wordpressin which WordPress rewrite works so I am stumped?

Thanks in advance

John

I have a page title "more" with subpage "cities-guide". Said "cities guide" page has a loop that pulls in posts from custom post type "thailife_city_guide".

My permalink structure is /%category%/%postname%/.

At present clicking a link to a custom post from www.mydomain.com/more/cities-guide gives "www.mydomain.com/thailife_city_guide/bangkok" for example.

I want it to be displayed as "www.mydomain.com/more/cities-guide/bangkok" but cannot get anything to work

I tried fixing the rewrite in the CPT register to 'rewrite' => array( 'slug' => 'more/cities-guide' ), but to no avail, throws a 404

Can someone please advise as I just dont really understand the way inwhich Wordpress rewrite works so am stumped?

Thanks in advance

John

I have a page title "more" with subpage "cities-guide". Said "cities guide" page has a loop that pulls in posts from custom post type "thailife_city_guide".

My permalink structure is /%category%/%postname%/.

At present clicking a link to a custom post from
www.mydomain.com/more/cities-guide gives
www.mydomain.com/thailife_city_guide/bangkok for example.

I want it to be displayed as www.mydomain.com/more/cities-guide/bangkok but cannot get anything to work

I tried fixing the rewrite in the CPT register to 'rewrite' => array( 'slug' => 'more/cities-guide' ), but to no avail, throws a 404.

Can someone please advise as I just dont really understand the way in which WordPress rewrite works so I am stumped?

Source Link
John
  • 95
  • 9

Custom Post Type Rewrite To Include Parent Page(s)

I have a page title "more" with subpage "cities-guide". Said "cities guide" page has a loop that pulls in posts from custom post type "thailife_city_guide".

My permalink structure is /%category%/%postname%/.

At present clicking a link to a custom post from www.mydomain.com/more/cities-guide gives "www.mydomain.com/thailife_city_guide/bangkok" for example.

I want it to be displayed as "www.mydomain.com/more/cities-guide/bangkok" but cannot get anything to work

I tried fixing the rewrite in the CPT register to 'rewrite' => array( 'slug' => 'more/cities-guide' ), but to no avail, throws a 404

Can someone please advise as I just dont really understand the way inwhich Wordpress rewrite works so am stumped?

Thanks in advance

John