Sensei Shortcodes

To display specific content, you can add shortcodes to the content area of a page or post.

Many shortcodes require an id or ids to function (e.g., course ID, lesson ID, teacher ID). For example, to find the ID of a course, go to Course > All Courses and select Edit for a course. The number in the browser’s address bar is the course ID. For example, in the image below, the course ID is 7707.

Course ID

The same method can be used to find lesson and teacher IDs.

Courses

[sensei_courses] – A list of courses

Option Description Choices Default Setting
teacher Show courses from specific teacher(s) Any valid user id(s) (comma separated) none (all teachers)
category Show courses from specific category(s) Any course category (id, slug or term name) none (all categories)
exclude Specific course(s) to exclude from display Any valid course id(s) (comma separated) none
ids Specific course(s) to display Any valid course id(s) (comma separated) none (display all courses)
number How many courses to display Any valid number No limit
orderby How to order the courses date, name, menu_order date
order Sort order asc, desc desc

Example

[sensei_courses teacher="136" category="fossils" exclude="94" number="5" orderby="name" order="asc"]

Featured Courses

[sensei_featured_courses] – A list of featured courses

Option Description Choices Default Setting
number How many featured courses to display Any valid number No limit
orderby How to order the courses date, name date
order Sort order asc, desc desc
teacher Display only courses by a specific teacher(s) One or more user ids (comma separated) All teachers

Example

[sensei_featured_courses teacher="136" number="5" orderby="name" order="asc"]

Courses per user

[sensei_user_courses] – A list of courses the currently logged in user is taking

Option Description Choices Default Setting
number How many featured courses to display Any valid number No limit
orderby How to order the courses date, name date
order Sort order asc, desc desc
status Whether to display in progress or completed courses active, completed no status (displays active and completed)

Example

[sensei_user_courses number="5" orderby="name" order="asc" status="completed"]

Teachers

[sensei_teachers] – A list of users with the teacher role, displayed as links to their author archive page

Option Description Choices Default Setting
include Specific users to include Any valid user ids none (display all teachers)
exclude Specific users to exclude Any valid user ids none (display all teachers)

Example

[sensei_teachers exclude="42"]

User messages

[sensei_user_messages] – A list of private Sensei messages for the currently logged-in user

There are no options for this shortcode.

Course page

[sensei_course_page] – Display the content of a specific course page by course id

Option Description Choices Default Setting
id (required) The id of the course to display Any valid course id none

Example

[sensei_course_page id="136"]

Course categories

[sensei_course_categories] – Display a list of course categories

Option Description Choices Default Setting
include Specific course categories to display Any valid course category id, slug, or term name none (display all)
exclude Specific course categories to exclude Any valid course category id, slug, or term name none (display all)
parent Display only categories with a specific parent Any valid course category id, slug, or term name. (To show only top-level categories, set parent=0) none (display all)
hide_empty Display only categories containing at least one course true, false false
orderby How to order the categories id, count, name, slug name
order Sort order asc, desc desc

Example

[sensei_course_categories exclude="fossils" orderby="name" order="asc" hide_empty="false"]

Unpurchased courses

[sensei_unpurchased_courses] – A list of all courses linked to a WooCommerce product, which the current user has not yet purchased

There are no options for this shortcode.

Lesson tags: courses, IDs, lessons, shortcodes, teachers
Back to: Getting started with Sensei