Get slug to point to different content of the same post

I have a custom post type in WordPress with custom meta boxes.

So I need a hierarchal post and also have a custom template set for each of the post (either Type1 or Type2).

This is how my slug looks,

http://example.com/taxonomy/type1 – for the primary post

http://example.com/taxonomy/type1/type2 – for the secondary post

The problem is that the type 2 page is essentially the same as the type1 just with a bit of additional information. And my client plans to have many posts in type1 which will lead to more posts in type2 and this will make managing hard.

I can save all the content I need for type2 posts within the parent type1 using meta boxes. I just need a way to point the URLs to the right data.

So if I access this URL, http://example.com/taxonomy/type1/type2, it will open primary post and load the data for it from a meta box (also has to load another template file). I want this done via php and don’t want to load all the content and edit it frontend using javascript.

Read more here: Get slug to point to different content of the same post

Leave a Reply

Your email address will not be published. Required fields are marked *