Listing Your Lessons

Do you want to list all the content (pages, posts or conditional content) that are completable lessons? You can with this shortcode:

[wpc_list_pages]

  • ‘child_of’: (int) Display only the sub-pages of a single page by ID. Default 0 (all pages).
  • ‘authors’: (string) Comma-separated list of author IDs. Default empty (all authors).
  • ‘depth’: (int) Number of levels in the hierarchy of pages to include in the generated list. Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to the given n depth). Default 0.
  • ‘exclude’: (string) Comma-separated list of page IDs to exclude.
  • ‘link_after’: (string) Text or HTML to follow the page link label. Default null.
  • ‘link_before’: (string) Text or HTML to precede the page link label. Default null.
  • ‘post_status’: (string|array) Comma-separated list or array of post statuses to include. Default ‘publish’.
  • ‘orderby’: (string) Comma-separated list of column names to sort the pages by. Accepts ‘post_author’, ‘post_date’, ‘post_title’, ‘post_name’, ‘post_modified’, ‘post_modified_gmt’, ‘menu_order’, ‘post_parent’, ‘ID’, ‘rand’, or ‘comment_count’. Default ‘post_title’.
  • ‘order’: (string) The order of the sort. Default ‘DESC’. Accepts ‘DESC’ or ‘ASC’.
  • ‘course’: (string) The completable lessons in a specific course.

If you want to order your course by your menu order (from inside WP), use ‘orderby’:

[wpc_list_pages orderby="menu_order"]

If this puts your lessons in the opposite order, add an ‘order’ to it:

[wpc_list_pages orderby="menu_order" order="DESC"]

(If it’s still in the wrong order, change DESC to ASC” for order)

If you want to show WPC completable pages that excludes a page with an ID of 3 in the course called BrandMasters, you’d use:

[wpc_list_pages exclude="3" course="BrandMasters"]

You can also exclude pages from your listing by using the show option. For example:

[wpc_list_pages show="complete" empty="Nothing to see here..."]

This would only show completed pages in your course, and if there were no completed pages, it’d read “Nothing to see here…”

You can do the opposite as well, which would only show incomplete lessons:

[wpc_list_pages show="incomplete" empty="You’ve finished the course!"]

There are two ways to filter by completed/not-completed lessons as well, you can either use completed=”true|false” or show=”completed|complete”, like this:

[wpc_list_pages show="incomplete"]

This would do the same thing:

[wpc_list_pages completed="false"]

You can now add any CSS you’d like to [wpc_list_pages] by adding a style modifier to our shortcode. You can also add a class modifier to add your own classes to the container ul tag.

For example: [wpc_list_pages class=”my-custom-class” style=”list-style: none;”] would remove bullets from the list of lessons, just for this specific instance (not for all instances). You can add any CSS you’d like within style=””.

You can filter by category or tag as well in your [wpc_list_pages] shortcode, by using the following syntax (categories require the category ID, whereas tags can be written out as the word):

[wpc_list_pages cat="2"]

Where “2” is the ID of the category you wish to filter by. So only lessons with the category ID of 2 will show in this list.

[wpc_list_pages tag="lesson"]

Where “lesson” is the name of the tag you wish to filter by. So only lessons with the tag of “lesson” will be shown in this list.

Return to Support Articles