Get slug to point to different content of the same post

Based on the new details in the question:

Instead of creating a separate “type2” post type, you could:

  • Put all the data together in the “type1” post
  • Have the “type2” permalink (example.com/taxonomy/type1/type2/) redirect to: example.com/taxonomy/type1/?type=type2 (you can make this query string whatever you want, but the gist is, redirect to a query string version of the “type1” permalink). You should be able to code this to a post status hook – whenever a post status changes to ‘publish’, if the post type is ‘type1’, add a wp_redirect from the URL structure you want people to type in to the query string version.
  • Make the “type1” template conditional. Use an if statement: if there is a $_GET request where type=type2, show the type2 content; else, show the type1 content.

Leave a Comment