Can slugs from posts and custom post types conflict?

I have a system built on WordPress where we’re using several custom post types, and I’m seeing some weird behaviour.

For instance, I have a CPT called “Flyers”, and I also have a CPT called “Templates”. The Templates CPT has a post called “Flyers”. In Flyers CPT I have a post called “Flyer 01”.

Read More

Now when I try to $_POST to the Flyer 01 permalink (/flyers/flyer-01/) it looks like WordPress is redirecting my request to Templates post called Flyers (/templates/flyers/).

Does anyone have any good ideas on what’s going on here? And how do I get it to stop doing that redirect?

Related posts

1 comment

  1. Once you are using POST method, so url is not visible (and search engines don’t take is into account), send the request using query string:

    add_query_var( array('post_type' = 'flyers', 'post_name' = 'flyer-01'), home_url() );
    

    In this way the url generated is something like http://example.com?post_type=flyers&post_name=flyer-01 is ugly to see, but no one have to see it… and it works (it should).

Comments are closed.