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
1 Answer
Reset to default 1Taking 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