LifterLMS Shortcodes

Access Plan Button

# Top

Description

Outputs a button which links to the purchase page for a LifterLMS access plan. Useful if you’re creating custom sales pages for courses or memberships.

By default the button will have the text defined by the access plan but this can be overridden. See the Custom Text example below.

Options

Name Accepts Default Description
classes string null Pass a space-separated list of additional CSS classes to add to the button.
id int null (Required) The WordPress Post ID of an Access Plan
size string default Controls the size of the button, accepts: “default”, “large”, or “small”
type string primary Controls the style of the button. Accepts “primary” (blue), “secondary” (grey), “action” (orange), or “danger” (red). Your theme and/or custom CSS may alter the colors defined by these styles.

Basic Usage

[lifterlms_access_plan_button id="1234"]

Advanced Usage

[lifterlms_access_plan_button id="1234" type="action" size="large" classes="extra-class another-class"]

Basic Usage with Custom Text

[lifterlms_access_plan_button id="1234"]Buy Now[/lifterlms_access_plan_button]

Available Since

Added in LifterLMS 3.2.5

Checkout

# Top

Description

Outputs the checkout page for purchasing courses and memberships in LifterLMS. When LifterLMS is installed a page named “Purchase” is created and the shortcode is added to the content. You can select any page you want to use for the checkout page but you need to make sure the page contains the shortcode in order to work.

Options

Name Accepts Default Description
cols int 2 Determines the number of columns on the checkout screen. 1 or 2 are the only acceptable values.

Usage

[lifterlms_checkout cols="2"]

Course Author

# Top

Description

Display the Course Author’s name, avatar, and (optionally) biography for a specific course.

If used on a LifterLMS Course no course_id is required.

If used on a LifterLMS Lesson or Quiz, the Syllabus of the parent course will be displayed automatically.

Options

Name Accepts Default Description
avatar_size int 48 Size (in pixels) for the display size of the author’s avatar.
bio string yes Accepts “yes” or “no”. If “yes”, the author’s bio will be displayed, if “no” the bio will not be displayed.
course_id int null Accepts the WP Post ID of a Course. If none supplied, uses the current post ID.

Usage

[lifterlms_course_author avatar_size="48" bio="yes" course_id="123"]

Available Since

Added in LifterLMS 3.6.0

Course Continue Button

# Top

Description

Displays a “continue” button linking to the next uncompleted lesson for a given course by the current user. If the course is complete, will display “Course Complete” text.

Will not display to logged out users.

If used on a LifterLMS Course no course_id is required.

If used on a LifterLMS Lesson or Quiz, the continue button of the parent course will be displayed automatically.

Options

Name Accepts Default Description
course_id int null Accepts the WP Post ID of a Course. If none supplied, uses the current post ID.

Usage

[lifterlms_course_continue_button course_id="123"]

Available Since

Added in LifterLMS 3.11.1

Course Information

# Top

Description

Outputs various pieces of course meta data. You may access any information found on the postmeta table about a course. The default pieces of course information are documented here.

Options

Name Accepts Default Description
id int null Defaults to the current coure ID. If used outside of a course you must supply an ID for the course you wish to display data about.
key string null Value of the meta key you wish to access. If accessing LifterLMS core properties you must omit the _llms_ prefix from the key!
type string string Accepts “string,” “date,” or “price.” For “date” and “price” options, the content will be automatically formatted before being output on screen.
date_format string null If type is date you may pass a valid date format which will be used to format the date before displaying on screen. Defaults to F j, Y

Usage

[lifterlms_course_info key="enrollment_end_date" type="date" format="Y-m-d"]

Course Meta Information (all)

# Top

Description

Display all meta information for a course.

Meta information includes:

  • Length
  • Difficulty
  • Tracks list
  • Categories list
  • Tags list

If used on a LifterLMS Course no course_id is required.

If used on a LifterLMS Lesson or Quiz, the Syllabus of the parent course will be displayed automatically.

Options

Name Accepts Default Description
course_id int null Accepts the WP Post ID of a Course. If none supplied, uses the current post ID.

Usage

[lifterlms_course_meta_info course_id="123"]

Available Since

Added in LifterLMS 3.6.0

Course Outline

# Top

Description

Outputs the course outline as displayed by the widget of the same name

Can be used on a course or lesson to show full course outline or just the current section outline.

Can be used on any page or post if a course_id is supplied to the shortcode.

Setting the outline_type to current_section refers to the section that contains the next uncompleted lesson for current student. If the student is not enrolled then the first section in the course will be displayed.

Options

Name Accepts Default Description
collapse bool false If true, will make the outline sections collapsible via click events
course_id int false Use the Post ID of any course to display that courses’s outline. If omitted displays the current course and will only function on a Course or Lesson screen.
outline_type string full Accepts “full” or “current_section”. Full displays the entire outline, current_section displays only the current section.
toggles bool false If true, will display “Collapse All” and “Expand All” toggles at the bottom of the outline. Only functions if “collapse” is true.

Usage

[lifterlms_course_outline collapse="true" toggles="true" course_id="123"]

Course Prerequisites

# Top

Description

Display a notice describing unfulfilled prerequisites for a course.

If used on a LifterLMS Course no course_id is required.

If used on a LifterLMS Lesson or Quiz, the Syllabus of the parent course will be displayed automatically.

Options

Name Accepts Default Description
course_id int null Accepts the WP Post ID of a Course. If none supplied, uses the current post ID.

Usage

[lifterlms_course_prerequisites course_id="123"]

Available Since

Added in LifterLMS 3.6.0

Course Progress

# Top

Description

Display the course progress bar. This can only be used inside Courses or Lessons.

Usage

[lifterlms_course_progress]

Course Progress with Continue Button

# Top

Description

Display a progress bar with continue button for a specific course. Renders only for enrolled students.

If used on a LifterLMS Course no course_id is required.

If used on a LifterLMS Lesson or Quiz, the Syllabus of the parent course will be displayed automatically.

Options

Name Accepts Default Description
course_id int null Accepts the WP Post ID of a Course. If none supplied, uses the current post ID.

Usage

[lifterlms_course_continue course_id="123"]

Available Since

Added in LifterLMS 3.6.0

Course Reviews

# Top

Description

Display reviews and review form for a LifterLMS Course.

If used on a LifterLMS Course no course_id is required.

If used on a LifterLMS Lesson or Quiz, the Syllabus of the parent course will be displayed automatically.

Options

Name Accepts Default Description
course_id int null Accepts the WP Post ID of a Course. If none supplied, uses the current post ID.

Usage

[lifterlms_course_reviews course_id="123"]

Available Since

Added in LifterLMS 3.6.0

Course Syllabus

# Top

Description

Display the Course Syllabus for a specific course.

If used on a LifterLMS Course no course_id is required.

If used on a LifterLMS Lesson or Quiz, the Syllabus of the parent course will be displayed automatically.

Options

Name Accepts Default Description
course_id int null Accepts the WP Post ID of a Course. If none supplied, uses the current post ID.

Usage

[lifterlms_course_syllabus course_id="123"]

Available Since

Added in LifterLMS 3.6.0

Course Title

# Top

Description

Output the title of a course. Can only be used on Course or Lessons.

Usage

[lifterlms_course_title]

Courses

# Top

Description

Display a loop of LifterLMS Course “Tiles” as displayed on the default “Courses” page.

Options

Name Accepts Default Description
category string null Display courses from a specific Course Category only. Use a category’s “slug”. If omitted, will display courses from all categories.
hidden string yes Whether or not courses with a “hidden” visibility should be included. Defaults to “yes” (hidden courses displayed). Switch to “no” to exclude hidden courses.
id int null Display only a specific course. Use the Courses’s Post ID. You can list multiple courses by separating IDs with commas.
mine string no Show only courses the current student is enrolled in. By default (“no”), shows courses regardless of enrollment. Available options to display by student’s course current course enrollment status: “any”, “enrolled”, “expired”, or “cancelled”
order string ASC Display courses in ascending or descending order. Accepts either “ASC” or “DESC”
orderby string title Determines which field is used to order courses in the courses list. Valid options are: ID, author, title, name, date, modified, rand, menu_order
posts_per_page int -1  Determines the number of results to display. Default returns all available courses.

Usage

[lifterlms_courses category="example-slug" order="ASC" orderby="date" posts_per_page="5"]

Hide Content

# Top

Description

Content inside shortcode will only be displayed to logged in members of the specified course, lesson, or membership.

If used on a course, lesson, or membership and no “id” is passed, will default to the ID of the current post.

Note: lessons do not have enrollment so if a lesson ID is supplied the user must be enrolled in the lesson’s parent course to be able to view the content within the shortcode.

Options

Name Accepts Default Description
id int Current Post ID Post ID of the course, lesson, or membership the user must belong to to view the content.
message string An optional text-only message displayed to users when they are not enrolled in the specified course, lesson, or mebership

Usage

[lifterlms_hide_content id="1234"]

This will only display to members of membership 1234

[/lifterlms_hide_content]

Available Since

In LifterLMS 3.1.1 the “id” and “message” parameters became available and the “membership” parameter was removed. This update is backwards compatible so the “membership” option still works.

 

Lesson Mark Complete Button

# Top

Description

Displays the lesson mark complete / mark incomplete button and form.

When a quiz is associated with the lesson, will display a “Take Quiz” button instead.

Must be used on a LifterLMS Lesson!

Only displays to enrolled students. If you’re an admin and not enrolled the button will not display!

Usage

[lifterlms_lesson_mark_complete]

Available Since

Added in LifterLMS 3.11.1

Login

# Top

Description

Displays the LifterLMS user login form.

If a user is already logged in, nothing is displayed.

Options

Name Accepts Default Description
layout string columns When “columns” is specified, form elements are displayed side by side. When “stacked” is specified, form elements are displayed on top of each other. The latter option is ideal for use in a sidebar.
redirect string null Allows you to specify a URL where the user will be redirected to after being successfully logged in. If none is specified, user will be redirected back to the same page the form is on. Must be a full resolvable URL.

Usage

[lifterlms_login layout="columns" redirect="http://mysite.tld/my-courses"]

Available Since

Added in LifterLMS 3.0.4

Memberships

# Top

Description

Display a loop of LifterLMS Membership “Tiles” as displayed on the default “Memberships” page.

Options

Name Accepts Default Description
category string null Display courses from a specific Membership Category only. Use a category’s “slug”. If omitted, will display courses from all categories.
id int null Display only a specific membership. Use the memberships’s post ID. If using this option, all other options are rendered irrelevant.
order string ASC Display courses in ascending or descending order. Accepts either “ASC” or “DESC”
orderby string title Determines which field is used to order courses in the courses list. Valid options are: ID, author, title, name, date, modified, rand, menu_order
posts_per_page int -1  Determines the number of results to display. Note that pagination is not available. Default returns all available courses

Usage

[lifterlms_memberships category="example-slug" order="ASC" orderby="date" posts_per_page="5"]

My Account

# Top

Decription

Outputs the login, registration, dashboard, profile and reset password templates. When LifterLMS is installed a page named “My Courses” is created and the shortcode is added to the content. You can select any page you want to use for the checkout page but you need to make sure the page contains the shortcode in order to work.

Options

Name Accepts Default Description
login_redirect* string null Allows you to specify a URL where the user will be redirected to after being successfully logged in. If none is specified, user will be redirected to their dashboard (default behavior). Must be a full resolvable URL.

Usage

[lifterlms_my_account]

* Parameter added in LifterLMS 3.2.2

My Achievements

# Top

Description

Outputs achievements using the achievement loop templates.

This is the content that is displayed under “My Achievements” on the My Account or My Courses page.

Options

Name Accepts Default Description
count (int) null Number of achievements to return. Omitting returns all achievements for given user
column (int) 5 Number of columns used when listing achievements
user_id (int) current user’s id Display achievements for a specific user. Omitting returns results for the user viewing the page where the shortcode is used

Usage

[lifterlms_my_achievements count="5"]

Pricing Table

# Top

Description

Outputs a LifterLMS Pricing table (like those found on a course or membership page) for a course or membership outside of a course or membership. Useful if you want to create custom sales pages.

When viewed by a user who is already enrolled in the course or membership, no content will be displayed. Students cannot enroll into a course twice so this will prevent duplicate enrollments. To create a better user experience, consider using this shortcode in conjunction with the Hide Content shortcode to display a message or link to already-enrolled users.

Options

Name Accepts Default Description
product int null (Required) The WordPress Post ID of a Course or Membership

Usage

[lifterlms_pricing_table product="123"]

 

Available Since

Added in LifterLMS 3.2.5

Registration

# Top

Description

Outputs registration page.

Usage

[lifterlms_registration]

Last Updated on
Was this article helpful?