Additional menu

Get MemberPress today! Start getting paid for the content you create! Get MemberPress Now

Available Courses Shortcodes

What is a shortcode?

Shortcodes are small placeholders you can insert almost anywhere within your WordPress page and post content. When visitors view the page, those placeholders get processed and replaced with some dynamically generated content instead.

Currently Available Courses Shortcodes

MemberPress Courses plugin includes several shortcodes that allow you to display courses or sections on any post or page outside the default course page.

Below, you can find the list of all available shortcodes for MemberPress Courses and related pages.

Course Listing

[mpcs-courses {parameters go here - see below}]  

Displays courses list with pagination. By default courses are displayed in 2 column layout with featured images, title, excerpt, author, lock icon for protected courses, and navigation. Displays courses list with pagination. By default, courses are displayed in 2 column layout with featured image, title, excerpt, author, lock icon for protected courses, and navigation.

All attributes below are optional.

  • hide_cards – remove default card styling and display courses as a list:
[mpcs-courses hide_cards="true"]
  • show_3_col – display courses in the 3-column layout:
[mpcs-courses show_3_col="true"]
  • hide_image – hide course featured image:
[mpcs-courses hide_cards="true" hide_image="true"]
  • hide_author – hide course author:
[mpcs-courses hide_cards="true" hide_author="true"]
  • hide_excerpt – hide course excerpt:
[mpcs-courses hide_cards="true" hide_excerpt="true"]
  • hide_lock_icon – hide lock icon that shows up next to the course title for protected courses:
[mpcs-courses hide_cards="true" hide_lock_icon="true"]
  • hide_navigation – hide next/prev navigation that shows up at the bottom below courses:
[mpcs-courses hide_cards="true" hide_navigation="true"]
  • tags – display only courses with the set course tags. The name of the course tag should be inserted instead of the dummy tag-name text in the code sample below:
[mpcs-courses tags="tag-name"]
  • categories – display only courses with the set course categories. The name of the course category should be inserted instead of the dummy category-name text in the code sample below:
[mpcs-courses categories="category-name"]
  • hide_protected – hide protected courses instead of showing the lock icon:
[mpcs-courses hide_protected]

Course Listing For Logged-In Users

[mpcs-my-courses {parameters go here - see below}]

Displays courses list with pagination but only for logged-in users. The default number of courses is 6 per page, but you can change it by applying the mpcs_courses_per_page filter as it is explained here – mpcs_courses_per_page.

Optionally, you can use one of the parameters below to display only courses with specific categories or tags:

  • categories – the list of categories slugs separated by a comma. You can get the slugs when you go to Courses page in WordPress Dashboard and click on the Categories button at the top of the page
[mpcs-my-courses categories="category_slug"]
  • tags – the list of tags slugs separated by a comma. You can get those slugs when you go to Courses page in the WordPress Dashboard and click on the Tags button at the top of the page
[mpcs-my-courses tags="tag_slug"]

Course Overview

[mpcs-course-overview {parameters go here - see below}]

Displays the list of all sections and lessons from a specific course. It requires only one parameter from the list below:

  • course_id – Course ID that you want to display. You can get this ID when you open the course in the WordPress Dashboard and check the number after the post parameter in the address bar. Where to find Course ID?
  • lesson_id – Lesson ID from the course that you want to display. To get this ID open the lessons page using a similar link: https://your-domain.com/wp-admin/edit.php?post_type=mpcs-lesson (make sure to replace your-domain.com part with your domain name), click lesson, and check the number after post parameter in the address bar. Where to find Lesson ID?
  • quiz_id – Quiz ID from the course that you want to display. To get this ID open the quizzes page using a similar link: https://your-domain.com/wp-admin/edit.php?post_type=mpcs-quiz (make sure to replace your-domain.com part with your domain name), click quiz, and check the number after post parameter in the address bar. Where to find Quiz ID?
An example shortcode might look like the following: 

[mpcs-course-overview course_id="710"]

List of Lessons Within A Course Section

[mpcs-section-overview lesson_id="XXX"]

Displays the list of lessons from a specific section. To select a section, you need to pass the lesson ID parameter from the section you want to display. To get lesson ID open the lessons page using a similar link: https://your-domain.com/wp-admin/edit.php?post_type=mpcs-lesson (make sure to replace your-domain.com part with your domain name), click lesson, and check the number after post parameter in the address bar. Where to find Lesson ID?. For example, if your lesson ID is 123, the shortcode would look like this:

[mpcs-section-overview lesson_id="123"]

Membership Purchase Button

[mpcs-purchase-button membership_id="XXX" text="BUTTON LABEL"]

Displays a purchase button that will redirect users to a membership signup page taken from the membership_id parameter. Where to find a Membership's ID?. Optionally, you can add a text parameter to change the default “Enroll” button text. Thus, if your membership ID is 123 and you want to add a button with the “Buy Now” label, the shortcode would look like this:

[mpcs-purchase-button membership_id="123" text="Buy Now"]

Download Certificate Link

[mpcs-certificate-link text="BUTTON LABEL"]

Displays certificate link that allows users to download certificates when they complete the course. It is useful when Classroom mode is disabled to display certificate links. Optionally, a text parameter can be added to change the default “Download Certificate” link text. For example, if you wish to add the link for downloading a certificate with the label “Get Your Certificate”, the shortcode would look like this:

[mpcs-certificate-link text="Get Your Certificate"]

The code above will work on the course page only. To display the certificate link on lesson or quiz pages, you must add the course_id parameter. Where to find Course ID?. The shortcode might look like this:

[mpcs-certificate-link text="Get Your Certificate" course_id="123"]

If you want to know more about shortcodes used in MemberPress, please check the list of available shortcodes.

Was this article helpful?

Related Articles

computer girl

Get MemberPress today!

Start getting paid for the content you create.