最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to merge 2 custom post type permalinks

programmeradmin1浏览0评论

I have 2 post types.

  • Course
  • Lesson

All lessons belong to the Course post type. Each lesson store the course ID in its meta.

I have a question for the permalink structure.

For the Course, I want below the permalink structure.

example/course/{course-category}/{course-title}

And for Lesson:

example/course/{course-category}/{course-title}/{lesson-title}

Or

example/course/{course-category}/{course-title}/lesson/{lesson-title}

E.g.

For Course:

If I have a course title 'First Course' in the category 'Cat 1'.

Then the expected URL is:

example/course/cat-1/first-course

For Lesson:

If I have a "Lesson" is 'Getting Started' and its Course is to 'First Course'.

Then the expected URL is:

example/course/cat-1/first-course/getting-started

or

example/course/cat-1/first-course/lesson/getting-started

Is this possible?

I have tried and make a course URL in work.

Currently working Course URL like:

example/course/cat-1/first-course

Lesson URL is also working as below:

example/course/first-course/lesson/getting-started

But, expected the 'cat-1' like:

example/course/cat-1/first-course/lesson/getting-started
发布评论

评论列表(0)

  1. 暂无评论