Sensei Shortcodes

You can add shortcodes to the content area of any page or post to display specific content. For more on shortcodes and how to use them, see WordPress Codex: Shortcodes.

A lot of shortcodes use id or ids as options. In order to find the ID of a course, go to Courses > All Courses and edit the course you want to use. The URL will now show the number that is the ID for your course. In the example below, the course ID is 7707.

sensei-courseid

Following the same principle, you can find the lesson and the teacher ID.

Sensei provides the following shortcodes as of v1.9.

Courses ↑ Back to top

[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="123" category="music" exclude="23" number="10" orderby="name" order="asc"]

Note: orderby="menu_order" – this is the order specified via Courses > Order Courses.

Featured courses ↑ Back to top

[sensei_featured_courses] – A list of featured courses

Options

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="123" number="10" orderby="name" order="asc"]

Courses per user ↑ Back to top

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

Options

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="10" orderby="name" order="asc" status="completed"]

Teachers ↑ Back to top

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

Options

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="23"]

User messages ↑ Back to top

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

Options

There are no options for this shortcode.

Course page ↑ Back to top

[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="123"]

Course categories ↑ Back to top

[sensei_course_categories] – Display a list of course categories.

Options

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="music" orderby="name" order="asc" hide_empty="true"]

Unpurchased courses ↑ Back to top

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

Options

There are no options for this shortcode.

Legacy shortcodes ↑ Back to top

The following shortcodes were deprecated in Sensei 1.9 and should no longer be used.

[newcourses] – displays the latest courses
[featuredcourses] – displays the courses marked as featured
[freecourses] – displays courses that do not require payment to take
[paidcourses] – displays courses that require payment to take
[usercourses] – displays the user’s active/completed courses, or a login/register form if they are not logged in.

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top