Change custom post type permalink to show name of post from another custom post type?

I have the post types competitions and class. My URLs look like this:

http://example.com/competition/postname/

and

http://example.com/class/postname/

I have meta field in the class post type that shows the post id of the competition in which this class belongs. I need to have my permalink for class like this:

http://example.com/competition/competitionpostname/classpostname/

Read more here: Change custom post type permalink to show name of post from another custom post type?

Leave a Reply

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