Lesson Shortcodes
Lesson Shortcodes
These shortcodes read from the current lesson, so they only produce output on a lesson page. On any other page they output nothing.
Lesson content and media respect LifterLMS drip settings: if the lesson is not yet available to the current student, the content, audio, and video shortcodes return nothing.
Keys ending in ID and URL use upper case. [le-lessons-next-URL] works; [le-lessons-next-url] does not.
When to use a lesson shortcode
Inside an Elementor lesson template, the Lesson widgets and dynamic tags are the better tools. Reach for a shortcode when the lesson layout is built somewhere else:
Lessons rendered by the theme — if lessons are not covered by an Elementor Theme Builder template, the theme's single-post layout renders the lesson content, and a shortcode in a theme sidebar or in the lesson body is the only way to add navigation or media. (The drip countdown is the exception — see its note below.)
Block-editor lesson bodies — a lesson whose content is written in the block editor can end with its own "Next lesson" link.
Other page builders — a text control that processes WordPress shortcodes but knows nothing about LifterLMS.
Lesson Content
Returns the lesson content as written in the block editor, with any LifterLMS blocks removed so only your own content is returned. Empty while the lesson is drip-locked for the current student.
Key: le-lessons-content · Output: HTML
[le-lessons-content]
Use it when — a layout built outside Elementor needs the lesson body with LifterLMS's own blocks (lesson navigation, mark-complete) stripped out, so you can place those elements yourself. Never put it inside the lesson's own content — it would render itself.
Lesson Audio URL
Returns the lesson's Audio Embed URL. Empty if none is set, or while the lesson is drip-locked.
Key: le-lessons-audio-url · Output: URL
[le-lessons-audio-url]
Lesson Video URL
Returns the lesson's Video Embed URL. Empty if none is set, or while the lesson is drip-locked.
Key: le-lessons-video-url · Output: URL
[le-lessons-video-url]
Use the media URL shortcodes when — you want the lesson's video or audio in a player of your choosing (an Embed block, a third-party player, a custom <video> tag) rather than LifterLMS's default embed. Because both return nothing while the lesson is drip-locked, the player simply does not appear before release — pair with Lesson Drip Time to show a countdown in its place.
Navigation shortcodes
The next and previous shortcodes follow the lesson order set in the course builder, across section boundaries.
Use them when — building your own previous/next links in a lesson layout that Elementor's Lesson Navigation widget does not reach — a theme sidebar, a block-editor lesson body, a footer. Because the URL shortcodes fall back to the course URL at the first and last lesson, a fixed pair of links never points nowhere:
<a href="[le-lessons-previous-URL]">← Previous</a> · <a href="[le-lessons-next-URL]">Next →</a>
The ID shortcodes are for developers passing the neighbouring lesson to another shortcode or snippet.
Lesson Next URL
Returns the URL of the next lesson in the course. If there is no next lesson (the current lesson is the last one), the course URL is returned instead. If there is a next lesson but the current student cannot access it yet, nothing is returned.
Key: le-lessons-next-URL · Output: URL
<a href="[le-lessons-next-URL]">Next lesson</a>
Lesson Previous URL
Returns the URL of the previous lesson. If there is none (the current lesson is the first one), the course URL is returned. If the student cannot access the previous lesson, nothing is returned.
Key: le-lessons-previous-URL · Output: URL
<a href="[le-lessons-previous-URL]">Previous lesson</a>
Lesson Next ID
Returns the post ID of the next lesson. Empty if there is no next lesson.
Key: le-lessons-next-ID · Output: number
[le-lessons-next-ID]
Lesson Previous ID
Returns the post ID of the previous lesson. Empty if there is no previous lesson.
Key: le-lessons-previous-ID · Output: number
[le-lessons-previous-ID]
Lesson Drip Time
Renders a live countdown to the moment a drip-scheduled lesson becomes available. Outputs nothing once the lesson is available, and nothing on lessons with no drip schedule.
The numbers are filled in by Lifter Elements' front-end script, which starts when Elementor initialises on the page. On a lesson rendered by your theme rather than an Elementor template, the shortcode outputs the countdown container but it stays empty. Use it on lessons covered by an Elementor Theme Builder template, or inside a Text Editor or Shortcode widget.
Users who can bypass LifterLMS content restrictions — administrators, and anyone covered by the Unrestricted Preview Access setting — are treated as though every lesson is already available, so the countdown renders nothing for them. Check it as an enrolled student.
This is the only Lifter Elements shortcode that accepts attributes.
Use it when — a drip-scheduled lesson should show "available in …" instead of an empty page, or the current lesson should tease when the next one unlocks (which_lesson="next"). Combined with the media shortcodes above, a locked lesson can show the countdown where the video will later appear. Set show="days" round="yes" for a calmer "36 Days" rather than a ticking 36 Days 6 Hours 10 Minutes 31 Seconds.
Key: le-lessons-drip-time · Output: HTML (countdown)
| Attribute | Values | Default | Description |
|---|---|---|---|
show | all, days, hours, minutes, seconds | all | Which units the countdown displays. |
round | yes, no | no | Round the displayed unit up: with show="days", adds a day once 12 or more hours remain in the current day; with show="hours", adds an hour once 30 or more minutes remain. Has no effect with other show values. |
which_lesson | current, next | current | Count down to the current lesson's release, or to the next lesson's. |
id | any text | 0 | Appended to the countdown's HTML id (le-lesson-drip-timer-<id>) so multiple countdowns on one page can be styled separately. |
[le-lessons-drip-time]
[le-lessons-drip-time show="days" round="yes" which_lesson="next"]
Notes
- The lesson shortcodes have equivalent dynamic tags for use inside Elementor, including separate Drip Days / Hours / Minutes / Seconds tags in place of the
showattribute. - The full list of registered shortcodes is also shown in your WordPress admin under Settings > Lifter Elements > Documentation.