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

url rewriting - Name page template properly

programmeradmin0浏览0评论

I have custom taxonomy in place which builds URL that way: domain/course/course-name/lesson

Course - is a custom post type.

I am facing difficulty to reach the right template for lessons. I've tried "page-course.php" but it doesn't work.

How should I call template for lessons?

I have custom taxonomy in place which builds URL that way: domain/course/course-name/lesson

Course - is a custom post type.

I am facing difficulty to reach the right template for lessons. I've tried "page-course.php" but it doesn't work.

How should I call template for lessons?

Share Improve this question asked Aug 25, 2020 at 8:15 AlexAlex 213 bronze badges 3
  • Are you trying to create a template that will be used for all posts in your 'course' CPT? Try calling your template `single-course.php' – Ben Commented Aug 25, 2020 at 8:35
  • Also, I don't know if you've come across this before, but this link is really helpful for template hierarchy, wphierarchy – Ben Commented Aug 25, 2020 at 8:36
  • 1 What is the lesson in your site. Is it custom taxonomy? – Pradipta Sarkar Commented Aug 25, 2020 at 9:01
Add a comment  | 

1 Answer 1

Reset to default 1

Taking a look at the template hierarchy, it says you should use single-course.php. The template hierarchy lists how. WP decides which template to load, and all the valid values

发布评论

评论列表(0)

  1. 暂无评论