1. Home
  2. WordPress Courseware Documentation
  3. Shortcodes

Shortcodes

Course Outline Shortcode

To make a Course created with WordPress Courseware Plugin visible, add the course outline shortcode to any Post, Page or Product. Example:

[wpcourse course="2" /]

The “2” refers to the course id. To find the course id, go to: Training Courses >

The course id is in the first column labeled ‘ID.’

Optional shortcode arguments let you decide which aspects of a course to make visible. The options are:

show_title – Default is ‘false.’ Set to ‘true’ to display the course title.
show_desc – Default is ‘false.’ Set to ‘true’ to display course description
module – Display just a specific module from the course. To find module numbers, go to Training Courses > . They are under the “Modules” column.
module_desc – Default is ‘false.’ Set to ‘true’ to display the Module descriptions.

Here’s an example of a shortcode which will display the outline for Course ‘2.’ It will display the Course Title, list of all Course Modules (Units and Quizzes) and Module descriptions:

 [wpcourse course="2" module_desc="true" show_title="true" show_desc="true" /]

WP Courseware Plugin- backend Make Course Visible from Page

Course Progress Shortcode

Add the following shortcode to any Page (Pages > Add New) in order to display a course progress panel for any course a student is enrolled in:

[wpcourse_progress]

Students click on Course ‘toggle’ to open the Unit Progress information.

WP Courseware Plugin- backend Add Page

Enrollment Button Shortcode

Add the following shortcode to any Page, Post or Product to display an ‘Enroll’ button to the frontend. You need to specify the Course ID that the user will be enrolled in after click. And, you have the option to define a custom label for the button. The default text that displays is “Enroll Now.”

[wpcourse_enroll courses="1, 10" enroll_text="Enroll in this Course!" /]

In the example above, the button will have the label “Enroll in this Course!” When clicked successfully, the user will be enrolled in Courses with the IDs ‘1’ and ’10.

To find a Course ID, go to Training Courses> The Course ID is displayed in the “ID” column on the left.

If the user IS NOT already enrolled in the course defined in the shortcode….
When a logged-in user clicks the button, they will automatically be enrolled in the course/s defined in the shortcode. A message will then display on the frontend confirming enrollment.

If the user is not logged-in, they’ll be redirected to the user registration page. After the user registers, they’ll be enrolled in the course/s defined in the shortcode.

If the user IS already enrolled in the course defined in the shortcode….
When the user clicks the button, the message “You have already been enrolled!” will appear.

Was this article helpful to you? Yes No

How can we help?