Here’s a shortcode that displays a user’s LearnDash profile information, in its default state, with no parameters:
Here’s that same shortcode with parameters added to it, to display the user’s courses in ascending order by course title:
There’s one other way to use a shortcode. You can check to see if a certain thing is true, and if it is, output the contents contained within the shortcode. Here’s an example that would check to see if someone is enrolled in the course, and if they are, display a message.
You’ll notice this version has both an opening & a closing shortcode, with the closing shortcode being preceded with a forward slash (/).
DEVELOPERS
You can also add shortcodes to your theme files or custom plugins via the do_shortcode() function.
All LearnDash Blocks & Shortcodes
Here’s a complete list of all available LearnDash blocks/shortcodes. Click on the name for more information on how to use them, as well as all the available parameters.
Block Shortcode Description
Common LearnDash Blocks/Shortcodes
LearnDash Profile Displays basic user information (name, avatar, etc.), as well as total courses, course points, a list of enrolled courses, quiz results & certificates earned.
LearnDash User Course Points Displays the earned course points, for that user, on any page.
LearnDash Course Progress Displays a progress bar with the user’s progress for that course.
LearnDash Course List
Temel İSG Eğitimi
Temel İSG Ders Listesi :
Konu
Teknik Konular
Sağlık Konuları
Genel Konular
Kurs Listesi
Temel İSG Eğitimi
———————
Ders Başlıkları:
Ön Değerlendirme Testi
D) Bağımlılık yapıcı maddeler
i) Acil durumlar, tahliye ve kurtarma
ı) İş sağlığı ve güvenliği genel kuralları ve güvenlik kültürü
h) Kişisel koruyucu donanım kullanımı
ğ) Sağlık ve güvenlik işaretleri
g) İş kazalarının sebepleri ve korunma prensipleri ile tekniklerinin uygulanması
f) Elektrik, tehlikeleri, riskleri ve önlemleri
e) Ekranlı araçlarla çalışma
d) İş ekipmanlarının güvenli kullanımı
ç) Yangın ve yangından korunma
c) Parlama, patlama
b) Elle kaldırma ve taşıma
a) Kimyasal, fiziksel ve ergonomik risk etmenleri
B) İş kazası ve meslek hastalığından doğan hukuki sonuçlar
d) Bağımlılık yapıcı maddeler ve teknoloji bağımlılığı
ç) İlkyardım
c) Biyolojik ve psikososyal risk etmenleri
C) Hastalıktan korunma prensipleri ve korunma tekniklerinin uygulanması
B) Meslek hastalıklarının sebepleri
Kurs Listesi:
Temel İSG Eğitimi
Sınav List
Copy of Temel İSG Eğitimi Sınavı
Ön Değerlendirme Testi
Temel İSG Eğitimi Sınavı
Kurs Listesi
Temel İSG Eğitimi
Kurs İçeriği
Firmanız
LearnDash Course Expire Status
LearnDash Video [ld_video] Displays a video anywhere within a lesson or topic page. You must be usingvideo progressionfor this shortcode to work.
Kurs Info
Giriş Yap: Login
Sertifika Certificate
LearnDash Resume Course Returns a user to the last step in the Course (format: link/button).
LearnDash Reset Password
Forgot Şifre
LearnDash Course Not Started
LearnDash Course In Progress
LearnDash Course Complete
LearnDash Quiz Complete
LearnDash Group Message
Certificate Shortcodes
View our list of certificate shortcodes
Common Blocks and Shortcodes
Let’s talk about how to use the main LearnDash shortcodes, and discuss the options available with each one. The method for customizing LearnDash blocks is the same for each block, so we’re going to focus on the code needed to customize the shortcodes. Remember, if you’re using the Gutenberg blocks, all the same options are available in the block options panel in the sidebar.
LearnDash Profile
The LearnDash Profile block/shortcode can be used to build a student profile. By default, it will output the following information related to the currently logged-in user:
Ava
Profil:
per_page=”10″ – sets the number of courses to display on one page, before pagination is used
course_points_user=”no” – prevents the display of a user’s earned course points (default is “yes”)
expand_all=”yes” – expands all sections of the profile (default is “no”)
orderby=”title” – determines how the courses should be sorted (default is “id”). This should be used in conjunction with the order parameter. See full list of orderby parameters
order=”ASC” – determines the order in which courses are sorted. This should be used in conjunction with the orderby parameter. Use either “ASC” or “DESC”.
profile_link=”no” – determines whether or not the profile link is shown or hidden. The default is yes.
show_quizzes=”no” – determines whether or not the users quiz attempts are shown or hidden. The default is yes.
show_search=”no” – determines whether the search functions is shown. The default is yes.
show_header=”no”– determines if the header is shown or hidden. The default is yes.
quiz_num=”5″ – sets number of quizzes to show per page when quizzes are shown & expanded. The default is to use whatever is set using per_page option.
LearnDash User Course Points
You likely won’t find many uses for the shortcode, but it could be used to build your own student profile page using a page builder.
Simply insert onto its own line, or use the block, and it will output this:
Earned Course Points: 100
This will display the total, cumulative points that the current user has received.This includes both “earned” course points as well as any “extra” course points you’ve assigned to the user via their WordPress profile.
There is only one parameter, if you want to target a specific user ID:
This would show the course points for the user with an ID of 5. The default usage will automatically show points for the logged-in user.
LearnDash Course Progress
The shortcode displays a progress bar with the current user’s progress for that course.
LearnDash course progress, frontend example
It is most commonly used on a course, lesson, topic or quiz page, and it automatically detects 1) which course is currently being accessed, and 2) which user is logged in.
You’ll typically use the default shortcode without any parameters, but if you’re using it outside of a course, or for a specific user, there are two options you can use:
– Displays the progress for a specific user
– Displays the progress for a specific course
This shortcode works great with page builders when building a custom layout for your courses, lessons & topics.
LearnDash Course List
The
Temel İSG Eğitimi
LearnDash course grid with the 3.0 theme applied
Because of the long list of options available, please head over to our Course Grid add-on article to learn about all of the available options.
This block allows for the display a sub-set of enrolled courses based on the course progress status. This is only available when the “My Courses” option is set to show “Enrolled Courses Only”.
LearnDash Lesson List
The LearnDash Lesson List works in much the same way as the Course List, only it displays lessons instead of courses. Here’s an example of it in use:
LearnDash lesson list, frontend example
This shortcode would be best used on a course page, instead of using the default course content table. Be sure to upload a featured image for each lesson to replace the placeholder images.
Here’s an example on how to use this shortcode:
Konu
Teknik Konular
Sağlık Konuları
Genel Konular
Konu
Teknik Konular
Sağlık Konuları
Genel Konular
You can specify a specific course by adding the course_id parameter to filter the lessons you want to display.
LearnDash Topic List
The LearnDash Topic List works in much the same way as the Lesson List,only it displays topics instead of lessons.
This would be best used on a lesson page that contains at least a few topics. A featured image will also replace these placeholder images.
Using the lesson_id parameter allows you to display a list of quizzes, or topics, associated with a specific lesson.
Here is an example of how to use the shortcode:
A) Çalışma Mevzuatı ile ilgili Bilgiler ve Çalışanların Yasal Hak Sorumlulukları
A) İşyeri Temizliği ve Düzeni
B) Meslek hastalıklarının sebepleri
C) Hastalıktan korunma prensipleri ve korunma tekniklerinin uygulanması
c) Biyolojik ve psikososyal risk etmenleri
ç) İlkyardım
d) Bağımlılık yapıcı maddeler ve teknoloji bağımlılığı
B) İş kazası ve meslek hastalığından doğan hukuki sonuçlar
a) Kimyasal, fiziksel ve ergonomik risk etmenleri
b) Elle kaldırma ve taşıma
c) Parlama, patlama
ç) Yangın ve yangından korunma
d) İş ekipmanlarının güvenli kullanımı
e) Ekranlı araçlarla çalışma
f) Elektrik, tehlikeleri, riskleri ve önlemleri
g) İş kazalarının sebepleri ve korunma prensipleri ile tekniklerinin uygulanması
ğ) Sağlık ve güvenlik işaretleri
h) Kişisel koruyucu donanım kullanımı
ı) İş sağlığı ve güvenliği genel kuralları ve güvenlik kültürü
i) Acil durumlar, tahliye ve kurtarma
A) Çalışma Mevzuatı ile ilgili Bilgiler ve Çalışanların Yasal Hak Sorumlulukları
A) İşyeri Temizliği ve Düzeni
B) Meslek hastalıklarının sebepleri
C) Hastalıktan korunma prensipleri ve korunma tekniklerinin uygulanması
c) Biyolojik ve psikososyal risk etmenleri
ç) İlkyardım
d) Bağımlılık yapıcı maddeler ve teknoloji bağımlılığı
B) İş kazası ve meslek hastalığından doğan hukuki sonuçlar
a) Kimyasal, fiziksel ve ergonomik risk etmenleri
b) Elle kaldırma ve taşıma
c) Parlama, patlama
ç) Yangın ve yangından korunma
d) İş ekipmanlarının güvenli kullanımı
e) Ekranlı araçlarla çalışma
f) Elektrik, tehlikeleri, riskleri ve önlemleri
g) İş kazalarının sebepleri ve korunma prensipleri ile tekniklerinin uygulanması
ğ) Sağlık ve güvenlik işaretleri
h) Kişisel koruyucu donanım kullanımı
ı) İş sağlığı ve güvenliği genel kuralları ve güvenlik kültürü
i) Acil durumlar, tahliye ve kurtarma
In this example, you can specify the lesson_id and course_id with the shortcode to filter the topics you want displayed.
LearnDash Quiz List
The LearnDash Quiz List works in much the same way as the Lesson List, only it displays quizzes instead of lessons. If your course offers multiple quizzes, you might find this shortcode useful.
Typically, however, quizzes are best displayed either…
in the course content table, along with the course they are associated with,
in the course navigation widget, wherever they fall in the natural course progress, or
at the bottom of a lesson or topic page that the quiz is assigned to (inserted automatically)
Using the lesson_id parameter allows you to display a list of quizzes, or topics, associated with a specific lesson.
LearnDash Group List
The LearnDash Group List works in much the same way as the Course List, only it displays groups instead of courses. If you offer multiple groups that allow for self-enrollment, you might find this shortcode useful.
The LearnDash Group List can be used in conjunction with the Course Grid add-on.
Because of the long list of options available, please head over to our Course Grid add-on article to learn about all of the available options.
LearnDash Course Content
The LearnDash Course Content block/shortcode is an exact replica of the default course content table that is displayed on course pages by default (below any content you add). It displays a complete overview of the course, along with the user’s progress. In it, you’ll find all Lessons, Topics and Quizzes that are assigned to the course. You can show/hide topics & quizzes that are tied to lessons, and you’ll see a status icon that displays the user’s status for that particular lesson/topic/quiz.
LearnDash course content table, frontend example
There are two really valuable use cases for this shortcode:
insert into a custom course landing page (if using a page builder)
insert into a sales page powered by WooCommerce, Easy Digital Downloads, MemberPress, or another ecommerce/checkout solution
When using this shortcode on any other page besides a course page, you’ll need to use the course_id parameter. This tells LearnDash which course you want to display content for.
This would display the course content table for the course with an ID of 12.
LearnDash User Groups
The LearnDash User Groups block/shortcodedisplays the list of groups that a user is assigned to.
LearnDash Course Expire Status
This block/shortcode will display the date in which a course expires for the currently logged-in user. You must enable the “Expire Access” setting on the course edit screen for this to work.
Course access will expire on: December 31, 2019
If used on a course page, will automatically detect the course, and the user, and display a message. The default messages are as follows:
If a course expires in the future: “Course access will expire on: {date}”
If a course has already expired: “Course access expired on: {date}”
You can customize the text before and after the date by using the following parameters:
label_before
This is displayed before the date:
label_after
This is displayed after the date:
format
This changes the format of the date used. By default, we’ll use your WordPress date settings. See a full list of date formatting options here.
You can also use the course_id & user_id parameters, although you will likely not need them because we identify these automatically.
Here’s an example of all parameters used together:
[ld_video]
The [ld_video] shortcode is only available as a shortcode. There is no Gutenberg block for it yet. However, you can still use it with the Gutenberg editor by utilizing the shortcode block:
LearnDash ld_video in shortcode block
This only works if you’re using our built-in Video Progression feature. This must be enabled on the lesson or topic page in order for it to work, and a URL to your video must be entered.
Learn how to set up video progression here
With video progression, by default, your video is placed above the course content. However, if you want to place the video somewhere in the middle of your content, you would use the [ld_video] shortcode.
There are no parameters. Simply add [ld_video] anywhere within your course content (must be on its own line).
This is great for use with page builders when customizing the layout of your lesson/topic pages. You have complete control of where to include your video.
LearnDash Payment Buttons
The LearnDash Payment Buttons should only be used if you’re utilizing one of the default LearnDash payment methods (Stripe, PayPal or 2Checkout). If you’re using WooCommerce, MemberPress, or any other platform to process payment, this block/shortcode will not work.
By default, if your course is set to any other status except for “Open,” you’ll see a “Take This Course” button on the course page. If you’re using one of LearnDash’s default payment methods, this button will begin the payment/checkout process for the user.
Example LearnDash payment button
If you want to place this button somewhere else on your page (i.e. if you’re using a page builder to create a custom course landing page), you can use the shortcode or block to insert the button anywhere.
If not used directly on a course page, you’ll want to include the course_id:
LearnDash Course Info
This block/shortcode could be used to help build part of a student profile page. LearnDash Course Info displays 3 things:
list of registered courses, along with a thumbnail image
list of course progress details, which includes:
course status: Not Started, In Progress or Completed
X out of Y steps completed
the date you started the course
list of quizzes you’ve taken, which includes:
quiz name & link to quiz page
score
points awarded
link to statistics
date you took it
grading status
Here’s what the registered courses looks like when you’ve included a featured image:
LearnDash Course Info, registered courses list
Here’s an example of the course progress information:
LearnDash Course Info, course progress details
And here’s the quiz information:
LearnDash Course Info, quiz statistics
The output might differ slightly depending on which theme you’re using.
You can use any of the following parameters to customize the output of (or use a bunch of them together). These are also available when using the Gutenberg block.
registered_show_thumbnail – set to “true” to show the thumbnail, or “false” to hide it
registered_num – limits the number of courses displayed
registered_orderby – order the registered courses by ID, title, date and more
registered_order – set to either ascending (“ASC”) or descending (“DESC”)
progress_num -limits the number of courses displayed in the progress section
progress_orderby -order courses in the progress section by ID, title, date and more
progress_order -set to either ascending (“ASC”) or descending (“DESC”)
quiz_num – limit the number of quizzes displayed
quiz_orderby -order quizzes by ID, title, date and more
quiz_order – set to either ascending (“ASC”) or descending (“DESC”)
You can also specify a user_id, but typically you don’t need this as we’ll automatically assign it to the current user.
LearnDash Login
Use the LearnDash Login shortcode to add a Login link to a page, post, sidebar widget, or menu item. When clicked, the LearnDash Login Modal pops-up.
When a user is logged-in, the link will update to: Logout. When clicked, a user will be logged-out of the site.
This shortcode will only work if LearnDash Login & Registration is enabled.
Here are available parameters for this shortcode:
‘url’ => false,
‘label’ => false,
‘icon’ => false,
‘placement’ => false,
‘class’ => false,
‘button’ => false,
‘login_url’ => ”,
‘login_label’ => __( ‘Login’, ‘learndash’ ),
‘login_icon’ => ‘login’,
‘login_placement’ => ‘left’,
‘login_class’ => ‘ld-login’,
‘login_button’ => ‘true’,
‘logout_url’ => ”,
‘logout_label’ => __( ‘Logout’, ‘learndash’ ),
‘logout_icon’ => ‘arrow-right’,
‘logout_placement’ => ‘right’,
‘logout_class’ => ‘ld-logout’,
‘logout_button’ => ”,
‘url’ => false,
‘label’ => false,
‘icon’ => false,
‘placement’ => false,
‘class’ => false,
‘button’ => false,
‘login_url’ => ”,
‘login_label’ => __( ‘Login’, ‘learndash’ ),
‘login_icon’ => ‘login’,
‘login_placement’ => ‘left’,
‘login_class’ => ‘ld-login’,
‘login_button’ => ‘true’,
‘logout_url’ => ”,
‘logout_label’ => __( ‘Logout’, ‘learndash’ ),
‘logout_icon’ => ‘arrow-right’,
‘logout_placement’ => ‘right’,
‘logout_class’ => ‘ld-logout’,
‘logout_button’ => ”,
Here’s a sample use case for these attributes:
LearnDash Certificate
This displays a Certificate download link for an earned certificate. One of the following parameters is required in order for the appropriate download link is displayed:
course_id – the ID number of a specific course
quiz_id – the ID number of a specific quiz
If you want to display a certificate for a certain quiz, both parameters above need to be used:
There are also optional parameters:
user_id – option to show link for a specific User (leave blank for current User)
group_id – option to show link to a specific group
label – label for certificate button/button link shown to user
class – HTML class for link element
context – user defined value to be passed into shortcode handler
callback – custom callback function to be used instead of default output
LearnDash Resume Course
Displays an option for Users to quickly return to the last step in a Course (format: link/button).
Supported Parameters:
course_id – enter single Course ID for the resume link (leave blank if used within a Course or if used outside of a course page, it will automatically pick up the last active course)
user_id – display resume option for a specific User (leave blank for current User)
label – label for link/button shown to User
Conditionally Display Content
These blocks & shortcodes work a little differently than the ones above. These 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 and ending like so:
[shortcode]and an ending[/shortcode]
[shortcode]and an ending[/shortcode]
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
When using Elementor Templates, the autop=”false” can be added within the shortcode for all conditionally displayed content to avoid having unwanted
and
elements from appearing throughout the template. This can be useful to avoid layout issues within templates.
LearnDash Visitor
LearnDash Student
You can also specify multiple course IDs on the shortcode with the following format:
If you want to limit to a specific group(s), you can use the group_id parameter just like the course_id parameter and specify the ID of the group(s) you want to only show content to for those that are enrolled into those groups.
You could also add a user_id parameter to the
LearnDash Course Not Started
LearnDash Course In Progress
LearnDash Course Complete
LearnDash Quiz Complete
LearnDash Group Message
LearnDash Reset Password
The new LearnDash Reset Password block allows you to set a “Reset Password” page for your users.
Just create a new page and insert the block anywhere you want. This will allow your users to reset their account passwords whenever they need to.
You can also use the shortcode
Forgot Şifre
On the block settings, you can change the width of the form to your liking.
