I have two Custom Post type,
register_post_type( 'classes',
array(
.
.
'rewrite' => array( 'slug' => 'classes', 'with_front' => false )
)
);
register_post_type( 'lessons',
array(
.
.
'rewrite' => array( 'slug' => 'chapters', 'with_front' => false )
)
);
I have created a custom admin UI to manage (create/update/delete) this two post type, the lesson post type is design to be a child post type for classes post type. So everytime someone create a lesson, it requires a parent post from the list of post type classes.
Now I have a problem with the url structure,
the URL of the classes will be site.dev/classes/class-post-name
and the URL of the lesson will be site.dev/chapters/lesson-post-name this is also the URL I can i see on wp_posts table under guid column
How can I acheive a URL structure like below that will also be stored as guid?
site.dev/classes/parent-post-post-name/chapters/lesson-post-name