LifterLMS Shortcodes

Introduction to Shortcodes Video

# Top

 

*Note: Many users no longer use shortcodes, and prefer to use the modern blocks method of adding content to a page in WordPress. All LifterLMS shortcodes on this page are also available as blocks. View the complete LifterLMS blocks documentation here.

What are LifterLMS Shortcodes?

# Top

LifterLMS has many shortcodes listed on this page below to help you add various LifterLMS features into your page builder, or just on WordPress pages, posts, or memberships. Shortcodes allow you to build many creative setups by harnessing the power of LifterLMS modules in new places on your website.

You can use the Course Syllabus shortcode to display a course and lesson structure on a sales page or even use the Courses shortcode to display courses based on category on a membership page.

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

Blocks Version of This Shortcode

We also have an “Access Plan Button” block option, if you want to use the block instead of a shortcode. Here is the Access Plan Button Block documentation.

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

Blocks Version of This Shortcode

We also have an “Checkout” block option, if you want to use the block instead of a shortcode. Here is the Checkout Block documentation.

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

Blocks Version of This Shortcode

We also have an “Course Author” block option, if you want to use the block instead of a shortcode. Here is the Course Author Block documentation.

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

Blocks Version of This Shortcode

We also have an “Course Continue Button” block option, if you want to use the block instead of a shortcode. Here is the Course Continue Button Block documentation.

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="start_date" type="date" date_format="Y-m-d"]

Blocks Version of This Shortcode

We also have an “Course Information” block option, if you want to use the block instead of a shortcode. Here is the Course Information Block documentation.

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

Blocks Version of This Shortcode

We also have an “Course Meta Information” block option, if you want to use the block instead of a shortcode. Here is the Course Meta Information Block documentation.

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

Blocks Version of This Shortcode

We also have an “Course Outline” block option, if you want to use the block instead of a shortcode. Here is the Course Outline Block documentation.

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

Blocks Version of This Shortcode

We also have an “Course Prerequisites” block option, if you want to use the block instead of a shortcode. Here is the Course Prerequisites Block documentation.

Course Progress

# Top

Description

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

Options

Name Accepts Default Description
check_enrollment int 1 Determines if the progress bar is shown to non-enrolled students.

Usage

[lifterlms_course_progress]

Blocks Version of This Shortcode

We also have an “Course Progress” block option, if you want to use the block instead of a shortcode. Here is the Course Progress Block documentation.

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

Blocks Version of This Shortcode

We also have an “Course Progress with Continue Button” block option, if you want to use the block instead of a shortcode. Here is the Course Progress with Continue Button Block documentation.

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

Blocks Version of This Shortcode

We also have an “Course Reviews” block option, if you want to use the block instead of a shortcode. Here is the Course Reviews Block documentation.

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

Blocks Version of This Shortcode

We also have an “Course Syllabus” block option, if you want to use the block instead of a shortcode. Here is the Course Syllabus Block documentation.

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

Blocks Version of This Shortcode

We also have an “Courses” block option, if you want to use the block instead of a shortcode. Here is the Courses Block documentation.

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,string Current Post ID Post ID (or comma separated list of Post IDs) 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
relation string all Defines the relationship of the id list when multiple IDs are used. all requires user to be enrolled in all of the specified courses, any requires at least one of the IDs.

Usage

 

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

Blocks Version of This Shortcode

We also have an “Lesson Mark Complete Button” block option, if you want to use the block instead of a shortcode. Here is the Lesson Mark Complete Button Block documentation.

My Favorites

# Top

Description

Displays a user’s favorite lessons, allowing quick access to preferred content within LifterLMS for an enhanced and personalized learning experience.

Usage

[lifterlms_favorites]

Available Since

Added in LifterLMS version 7.5.0

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

Blocks Version of This Shortcode

We also have an “Login” block option, if you want to use the block instead of a shortcode. Here is the LifterLMS Login Block documentation.

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

Blocks Version of This Shortcode

We also have an “Memberships” block option, if you want to use the block instead of a shortcode. Here is the Memberships Block documentation.

 

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

Blocks Version of This Shortcode

We also have an “My Account” block option, if you want to use the block instead of a shortcode. Here is the My Account Block documentation.

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
columns (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"]

Blocks Version of This Shortcode

We also have an “My Achievements” block option, if you want to use the block instead of a shortcode. Here is the My Achievements Block documentation.

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

Blocks Version of This Shortcode

We also have an “LifterLMS Pricing Table” block option, if you want to use the block instead of a shortcode. Here is the LifterLMS Pricing Table Block documentation.

Registration

# Top

Description

Outputs registration page.

Usage

[lifterlms_registration]

Blocks Version of This Shortcode

We also have an “Register” block option, if you want to use the block instead of a shortcode. Here is the Register Block documentation.

Last Updated on
Was this article helpful?