Categories

Shortcodes & Blocks

Conditionally Display Content

These blocks & shortcodes help you show or hide specific information for certain users, based on their enrollment status.

You can include HTML, images, video or anything else you’d like inside of these shortcodes.

All of these shortcodes require a beginning [shortcode] and an ending [/shortcode]

, with content in the middle. Be sure to include both.

When using these Gutenberg blocks, you’ll see a small indicator when hovering over the block to let you know that the content you add will be placed inside the conditional block:

LearnDash conditional shortcode, block example in admin
Example paragraph block used within the LearnDash Course In Progress block

LearnDash Visitor [visitor]

You can use this block/shortcode to only show certain information to students who are not yet enrolled in a course. It is most commonly used on the course page itself, but can also be used on a custom sales page by specifying a course_id. Here’s an example:

[visitor course_id="12"]
This will only be seen by users who DO NOT have access to the course. You could provide a link to a signup form or email capture here.
[/visitor]

LearnDash Student [student]

Use this shortcode to only display some content to a student who has access to the course.

[student course_id="12"]
This will only be seen by users who HAVE ACCESS to the course.
[/student]

You could also add a user_id parameter to the [student] shortcode if you wanted to target a specific student by his or her ID.

[student user_id="5"]
This will only be seen by the user whose ID is 5. No other students will see it.
[/student]

LearnDash Course Not Started [course_notstarted]

This will show content to those who have not completed any steps in the course thus far.

[course_notstarted course_id="12"]
This will only be seen by users who have not completed any steps in the course yet. You could provide a message encouraging them to get started.
[/course_notstarted]

LearnDash Course In Progress [course_inprogress]

This shows content to a student who has started the course, but not yet finished it.

[course_inprogress course_id="12"]
This will only be seen by users who have started the course (completed at least one step), but not yet finished it. You could provide encouragement for them to finish it soon.
[/course_inprogress]

LearnDash Course Complete [course_complete]

Use the [course_complete] shortcode to show content only to students who have fully completed a course (completed all steps & passed all required quizzes).

[course_complete course_id="12"]
This will only be seen by users who have fully completed the course. You could provide a link to a certificate here, or some related courses they might want to try next.
[/course_complete]

LearnDash Quiz Complete [ld_quiz_complete]

Use the [ld_quiz_complete] shortcode to show content only to students who have fully completed a quiz.

[ld_quiz_complete quiz_id="32"]
This will only be seen by users who have fully completed the course. You could provide a link to a certificate here, or some related courses they might want to try next.
[/ld_quiz_complete]

LearnDash Group Message [ld_group]

Use the [ld_group] shortcode to show content only to students enrolled in the specified group. Requires group ID.

[ld_group group_id="32"]
This will only be seen by users who have access to the group with the ID of 32.
[/ld_group]