WooCommerce Docs

Documentation, Reference Materials, and Tutorials for your WooCommerce products

Search

Sensei Theming

Sensei Theming ↑ Back to Top

A comprehensive guide to theming in Sensei.

Note: If your Sensei content isn’t displaying how it should, please check out Sensei & Theme Compatibility

Sensei’s templating system is simple for developers to understand and to customize in their theme. You will find Sensei’s template folder in the plugin’s root directory, under /templates/ – this is the folder that contains all the HTML that Sensei will output on the frontend.

You can override any of the templates found in this folder by copying them to /yourthemefolder/sensei/ and editing the files there. Sensei will automatically load any template files you have in that folder, and use them instead of its default template files.

This is the safest way to make changes to Sensei’s templates, as it means that your changes will not be overwritten when Sensei is updated.

Making Changes ↑ Back to Top

Before you continue to look at the file structure, please take a look at our template hooks. This will allow you to make most of your customizations without ever touching the template files:
https://docs.woocommerce.com/sensei-apidocs/

Course Archives ↑ Back to Top

The course archive page is handled by the following files:

  • archive-course.php
  • loop-course.php
  • content-course.php

The archive will output all course with filters at the top which can be used to further filter the courses listed.

The URL for this page will be the same as the page set within Admin > Sensei > Settings > General > Course Archive Page.

Lesson Archives

The lesson archive page is handled by the following files:

  • archive-lesson.php
  • loop-lesson.php
  • content-lesson.php

These files will display a simple archive list of all lessons that have been created.

Single Course ↑ Back to Top

The individual course page is handled by single-course.php

These files will output the individual course and its contents. The relevant functions that the files make use of are:

Single Lesson ↑ Back to Top

The individual lesson page is handled by the following files:

  • single-lesson.php

These files will output the individual lesson and a link to the lesson quiz.

Single Quiz ↑ Back to Top

The individual quiz page is handled by the single-quiz.php.

The following files are used by the single quiz page to output questions types:

  • /single-quiz/question_type-boolean.php (True/False questions)
  • /single-quiz/question_type-essay-paste.php (Essay questions)
  • /single-quiz/question_type-gap-fill.php (Gap Fill questions)
  • /single-quiz/question_type-multi-line.php (Multi Line questions)
  • /single-quiz/question_type-multiple-choice.php (Multiple Choice questions)
  • /single-quiz/question_type-single-line.php (Single Line questions)

These files will output the lessons quiz questions and handle submission of the users question answers. The relevant functions that the files make use of are:

Learner Profiles ↑ Back to Top

The learner profile pages are handled by learner-profile.php

These files handle the display of the learner profiles. The relevant functions that the files make use of are:

Course Results ↑ Back to Top

The course results page is handled by these template files:

  • course-results.php
  • course-results/lessons.php

These files handle the display of the course results. The relevant functions that the files make use of are:

Course Categories ↑ Back to Top

The course category makes use of the course archive templates. See above.

My Account ↑ Back to Top

The My Account page will show a list of the users Active Courses as well as their Completed Courses. The template file that is used is /user/my-courses.php 

Access Errors ↑ Back to Top

If  a user does not have access to a specific area of the Course, Lesson, or Quiz, the output will be handled by no-permissions.php to display the relevant error message.

Advanced Customization: Hooks ↑ Back to Top

As mentioned above, Sensei comes with many hooks, that can be used to change its default behaviour. Themes and plugins can use these actions and filters to make very advanced modifications to Sensei, all without touching the plugin’s core code.

Back to the top