Shortcodes Documentation

List of Additional Shortcodes for LearnDash and Course Reviews for LearnDash.

Course Grid Shortcodes

				
					ea_ld_course_grid
				
			

This shortcode shows the LearnDash courses on the site in different styles depending on the templates, as well as with different extra functionalities. It can take multiple parameters, as follows:

  • Template: a number between 1 and 6 to define the style corresponding to an EA template. e.g template=”1″
  • Columns: the number of columns to display the courses. This only applies to some templates, it can be a number between 1 and 4. Also, this only applies for desktops, the grid will only have 1-2 columns on mobile and tablets regardless of this parameter. e.g columns=”4″
  • Posts_per_page: How many courses can it show at a time before requesting more? This only applies to template 6 at the moment, since is the only one that has a “more courses” button that reloads the following courses (like Ajax pagination basically). e.g posts_per_page=”5″
  • Featured_courses: a parameter that makes the grid, instead of showing all courses, just show courses with the meta field “featured”. Also, template 1 changes the styling. e. featured_courses=”true”
 
Extra Meta fields created:
  • product_id: This plugin now automatically adds a product_id meta to a course. It is saved when a user creates/updates a Woocommerce product with an associated course. For now, it only works with the FIRST associated course.

    If a course has a product_id pointing to a correct WC product, then the price of that product will be used on the course grid to show the price of the course. If not, then it will show the price of the course in the Learndash course settings.

  • featured: this meta is used to simply point out that is a course the user wants to showcase more than others. This meta is checked when the featured_courses parameter of the shortcode is used.
  • instructor_id: this meta is used when a course card needs to show the instructor of a course. The value should be the id of a current user.
  • course_start_date: course cards in template 4 show the start date for a course. Instead of doing something complicated, we just have a meta field called course_start_date that is a String.
 

How are ratings shown?

First, it will see if the Course Reviews for LearnDash plugin is active, if so then it will show the average rating for a course. If the plugin is not active, it will try to show the average rating of the associated Woocommerce product of the course (i.e product_id meta field)
 

How are prices shown?

First, it will see if the LearnDash course has a valid ‘product_id’ meta field, meaning a valid associated WooCommerce product. If so, it will assume the user uses the WooCommerce product to sell the course, therefore the real price is the one from the product. In that case, it will show the price of the associated product, if not then simply show the price in the settings of the LearnDash course.
 
				
					ea_ld_course_grid template="1"
				
			
				
					ea_ld_course_grid template="1" featured_courses="true"
				
			
				
					ea_ld_course_grid template="2"
				
			
				
					ea_ld_course_grid template="3"
				
			
				
					ea_ld_course_grid template="4"
				
			
				
					ea_ld_course_grid template="6"
				
			

Course Categories Shortcode

This shortcode displays the course categories in a grid with images. Images in course categories are NOT part of LearnDash, this is new functionality added by this plugin. Meaning a user when creating/editing a LearnDash course category can now add a featured image like in post/pages/products.

Additional parameters:

  •  with_links: (true/false) to have a link to a course category archive in each card. Default is false.
				
					ea_ld_course_categories with_links="true"
				
			

Site Information Shortcodes

These shortcodes are meant to just display information about the site in a simple way.

				
					ea_author id="post id"
				
			

Self-explanatory. Displays the name of the author of the post/page.

jose
				
					ea_current_year
				
			

Displays the current year.

2024
				
					ea_site_title
				
			

Displays the name of the site.

learndash-template 1

LearnDash Specific Shortcodes

These shortcodes are meant to break existing LearnDash shortcodes into small bits.

				
					ea_ld_stats_points id="x"
				
			

Render a simple text with the number of points the user has. Current logged-in user by default.

No user found with that ID
				
					ea_ld_stats_certificates id="x"
				
			

Render a simple text with the number of certificates the user has. Current logged-in user by default.

No user found with that ID
				
					ea_ld_stats_enrolled id="x"
				
			

Renders a simple text with the number of enrolled courses the user is in. Current logged-in user by default.

No user found with that ID
				
					ea_ld_stats_completed id="x"
				
			

Renders a simple text with the number of courses the user has completed. Current logged-in user by default.

No user found with that ID
				
					ea_ld_stats_course_progress id="X" course_id="Y" type='percentage'
				
			

Renders a simple text with the % of completion a user has with a course by course_id. The Type parameter by default is ‘percentage’, any other value will render “An out of B steps”. See examples below.

No user found with that ID
No user found with that ID
				
					ea_ld_user_avatar id="X" type="horizontal" size="medium"
				
			

Renders a the avatar with the name of a user by id.

Type can be ‘horizontal’ or ‘vertical’ (default). Size can be ‘tiny’, ‘small’ or ‘medium’ (default).

No user found with that ID
No user found with that ID
No user found with that ID
No user found with that ID
No user found with that ID
No user found with that ID
				
					ea_ld_stats_questions global="true" course_id="x" user_id="y"
				
			

Display the total number of questions of quizzes with some parameters:

  • global (false by default): if true, it will just display the number of questions on all quizzes or on quizzes that are part of a course (course_id)
  • course_id: to count questions on quizzes that are part of a course. (optional)
  • user_id: to show the number of questions of all attempted quizzes the user has done. In general or attempted quizzes that are part of a specific course by course_id.
16
				
					ea_ld_quiz_last_attempt  quiz_id="x" user_id="y"
				
			

Display the date of the last attempt by the user on a specific quiz.

April 5, 2022 2:24 pm
				
					ea_ld_quiz_average course_id="x" user_id="y" type="percentage"
				
			

Display the average score by ‘type’ of attempted quizzes by the user_id in a course_id or globally:

  • user_id (current user id by default): ID of the user
  • course_id: ID of the course. Optional
  • type: ‘percentage’ or ‘score’. Percentage by default
100%
				
					ea_ld_quiz_last_score user_id='' quiz_id='' course_id=''  type='percentage'
				
			

Display the last score (points or percentage) of the last attempted quiz by a user.

  • user_id: ID of the user. Default to currently logged-in user
  • course_id: ID of the course
  • quiz_id: ID of a particular quiz to find the last score of attempts of that quiz. Optional
  • type: ‘percentage’ or ‘score’. Percentage by default.
100%

Course Content Shortcode

This shortcode displays the content (lessons, topics, etc) of a course depending on a template style. It only has two parameters: course_id and template.

				
					ea_ld_course_content
				
			
Programming: telling a computer what to do
Telling a computer what to do
Built-in data types
Basic Definitions
Data type for computing with strings
Input and output
Program development in Java
Program development with switches and lights
Software for program development: tradeoffs
Lesson 1 – Introduction
View Details

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla porta, ipsum tempor sollicitudin dignissim, nulla enim scelerisque magna, non aliquet diam felis id sapien. In egestas at est sit amet iaculis. Maecenas sem diam, interdum lacinia pulvinar non, finibus faucibus tellus

Lesson 2 – Algorithms
View Details

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla porta, ipsum tempor sollicitudin dignissim, nulla enim scelerisque magna, non aliquet diam felis id sapien. In egestas at est sit amet iaculis. Maecenas sem diam, interdum lacinia pulvinar non, finibus faucibus tellus

Lesson 3 – Network Typologies
View Details

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla porta, ipsum tempor sollicitudin dignissim, nulla enim scelerisque magna, non aliquet diam felis id sapien. In egestas at est sit amet iaculis. Maecenas sem diam, interdum lacinia pulvinar non, finibus faucibus tellus

Lesson 4 – Fundamentals of Java Language
View Details

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla porta, ipsum tempor sollicitudin dignissim, nulla enim scelerisque magna, non aliquet diam felis id sapien. In egestas at est sit amet iaculis. Maecenas sem diam, interdum lacinia pulvinar non, finibus faucibus tellus

Lesson 5 – Programming in C / C ++
View Details

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla porta, ipsum tempor sollicitudin dignissim, nulla enim scelerisque magna, non aliquet diam felis id sapien. In egestas at est sit amet iaculis. Maecenas sem diam, interdum lacinia pulvinar non, finibus faucibus tellus

Lesson 6 – Programming for the WEB
View Details

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla porta, ipsum tempor sollicitudin dignissim, nulla enim scelerisque magna, non aliquet diam felis id sapien. In egestas at est sit amet iaculis. Maecenas sem diam, interdum lacinia pulvinar non, finibus faucibus tellus

Lesson 1 – Introduction
Lesson 2 – Algorithms
Lesson 3 – Network Typologies
Lesson 4 – Fundamentals of Java Language
Lesson 5 – Programming in C / C ++
Lesson 6 – Programming for the WEB
Lesson 1 – Introduction
Programming: telling a computer what to do
Telling a computer what to do
Lesson 2 – Algorithms
Built-in data types
Basic Definitions
Lesson 3 – Network Typologies
Data type for computing with strings
Input and output
Lesson 4 – Fundamentals of Java Language
Program development in Java
Program development with switches and lights
Software for program development: tradeoffs
Lesson 5 – Programming in C / C ++
Lesson 6 – Programming for the WEB

Course Price

This shortcode displays the price of a LearnDash course. Some things to consider:

  • If there is a valid product_id meta field in the course it will assume the price of the course is the price of the associated WooCommerce product, and show that price
  • If the ID belongs to something other than a course, it will show an error message.
				
					ea_ld_course_price course_id="53"
				
			

$40.00

Course Price with Discount Shortcode

This shortcode displays the price of a LearnDash course with a manual discount attached to it if the user wants it, alongside a button.

Things to consider:

  • This will show the price of a course with the same consideration as the shortcode above (the ‘product_id’ consideration).
  • If a manual discount is in the parameter, then it will show that discount. If not, it will show if there is a product_id and the WooCommerce product has a sale price a.k.a it will show the “real” discount off the associated WooCommerce product.
				
					ea_ld_course_price_discount course_id="53" discount="10"
				
			

10% Disc. 44.44

» $40.00

Product Star Rating Shortcode

This shortcode displays the star rating of a WooCommerce product with a bunch of parameters:

  • product_id: Id of the product. Throws message of there is no product with that id.
  • link: True/false. Whether to show as a hyperlink to the product itself. Default true.
  • new_window: If there is a link, should it open in a new tab? Default true.
  • no_rating_text: Text to show of there is no rating. Default is “Be first to rate ___”.
  • show_rating_text: Whether to show the rating in a number or not. Default true.
  • show_stars: (true/false) whether to show rating in Woocommerce stars or not. Default true.
  • rating: To add a custom rating instead of the official product rating (a number between 0 and 5 e.g 2.5).
				
					ea_wc_star_rating product_id="360"
				
			

Course Reviews Documentation

The following shortcodes are part of the Course Reviews for LearnDash plugin.

Reviews Shortcode

				
					ea_ld_reviews
				
			

By default this shortcode renders three sections: 1) A review submit form only for logged-in users 2) a Summary displaying average rating and progress bars and 3) a List of reviews with pagination.
Parameters:

  • id: ID of the course. Default to the current page.

Reviews

Write a review

Please Wait...

4

Reviews

5 Stars

Click to select/unselect 5 Star reviews

4 Stars

Click to select/unselect 4 Star reviews

3 Stars

Click to select/unselect 3 Star reviews

2 Stars

Click to select/unselect 2 Star reviews

1 Stars

Click to select/unselect 1 Star reviews

REPLACEWITHREVIEWERNAME

REPLACEWITHREVIEEWHEADING

REPLACEWITHREVIEW
REPLACEWITHOFFSETTEXT

No reviews.

Reviews List Shortcode

				
					ea_ld_reviews_list id="118" stars="5" columns="2"
				
			

Additional parameters:

  • stars: 1, 2, 3, 4 or 5. To show reviews with those ratings. “all” by default, meaning it will show all.
  • columns: To show the reviews in 1 or 2 columns. 1 by default. The columns only appear from tablet (width > 900px).

jose

Review #5

Review Detailasassa

jose

Review #3

Review Detaildddd

Reviews Summary Shortcode

				
					ea_ld_reviews_summary id="118" 
				
			

4

Reviews

5 Stars

4 Stars

3 Stars

2 Stars

1 Stars

Review Form Shortcode

				
					ea_ld_review_form id="118"
				
			

NOTE: ea_ld_review_form can not be used on the same page as ea_ld_reviews.

Write a review