Listing Your Lessons
WPComplete allows site owners to display completable content dynamically using the [wpc_list_pages] shortcode. This shortcode can be used to list lessons, posts, pages, or other completable items with flexible filtering and styling options. It’s especially useful for displaying a learner’s progress or building custom navigation lists.
Shortcode Parameters
The [wpc_list_pages] shortcode supports several parameters for customizing which lessons appear and how they are displayed:
- ‘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.
Examples
Order Lessons by Menu Order
[wpc_list_pages orderby="menu_order"]
If the list appears out of order, adjust the sort direction:
[wpc_list_pages orderby="menu_order" order="ASC"]
If needed, try switching between ASC and DESC to correct the order.
Exclude Specific Pages
To exclude a page with ID 3 from the course BrandMasters:
[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 would 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!"]
Filtering by Completion Status
Show Only Completed Lessons
[wpc_list_pages show="complete" empty="Nothing to see here..."]
If no lessons are completed, the message “Nothing to see here…” will be shown.
Show Only Incomplete Lessons
[wpc_list_pages show="incomplete" empty="You’ve finished the course!"]
Alternatively, use the completed parameter:
[wpc_list_pages completed="false"]
These two versions are equivalent:
[wpc_list_pages show="incomplete"]
[wpc_list_pages completed="false"]
Styling the List
Custom styles can be applied directly to the shortcode using the class and style parameters:
[wpc_list_pages class="my-custom-class" style="list-style: none;"]
style: Adds inline styles (e.g., to remove bullet points).
class: Adds a custom CSS class to the <ul> container.
Filtering by Category or Tag
Filter by Category (Using Category ID)
[wpc_list_pages cat="2"]
This displays only lessons in the category with ID 2.
Filter by Tag (Using Tag Slug)
[wpc_list_pages tag="lesson"]
This displays only lessons tagged with "lesson".
Conclusion
The [wpc_list_pages] shortcode gives site owners full control over how completable content is displayed. With support for filters, sorting, styling, and conditional display, it can be tailored to meet a wide range of course layouts and learner experiences.