I am trying to Convert the Parent Page URL into Sinular Name format when the child page is open, for instance:
Parent Page: abc/courses
The child Page Should be: abc/course/course-name
(Required this format when child page open removed s from parent name URL only).
I don't need this format to create another page with the course name redirecting to courses and call the child page's parent course.
I am trying to Convert the Parent Page URL into Sinular Name format when the child page is open, for instance:
Parent Page: abc.com/courses
The child Page Should be: abc.com/course/course-name
(Required this format when child page open removed s from parent name URL only).
I don't need this format to create another page with the course name redirecting to courses and call the child page's parent course.
When registering your CPT, the rewrite
and has_archive
parameters will control the URLs (untested):
register_post_type( 'course', array(
...
'rewrite' => array(
'with_front' => false,
'slug' => 'course',
),
'has_archive' => 'courses',
);