Using Same Permalink With Custom Post Type (1 post)

  1. suntower
    Posted 3 years ago #


    My Permalinks are the std %postname%. I have several custom post types, eg. 'docs'.

    function docs_init() {
    	// create a new taxonomy
    			'label' => __( 'Documentation_Tax' ),
    			'sort' => true,
    			'args' => array( 'orderby' => 'term_order' ),
    			'rewrite' => array( 'slug' => 'docs' )

    I would like to be able to have duplicate slugs. Eg. I'd like to have a general Page with the slug 'MyPage' and then a Docs post type also with the slug 'MyPage'. The goal is to have users be able to do this:

    URL: mysite.com/mypage ---- general Page
    URL: mysite.com/docs/mypage ---- posttype Docs

    ...and this does not work. If the user types /docs/mypage, the browser redirects to /mypage.

    I thought that since 'with_front' defaults to true, WordPress would distinguish between the two slugs by assigning the 'front' (ie. the post type.)

    How can I get what I want?



Topic Closed

This topic has been closed to new replies.

About this Topic