Support » How-To and Troubleshooting » Using Same Permalink With Custom Post Type

Using Same Permalink With Custom Post Type

  • Hi,

    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?



  • The topic ‘Using Same Permalink With Custom Post Type’ is closed to new replies.