Lesson navigation

Note: If you are using “Menu Order” to order your lessons for WPC – WordPress sometimes reverses the order (meaning the next lesson shows up as the previous one, and vice versa). You can combat this by using order=”DESC” .

If you’d like to add a way for students to navigate forward and backward in your lessons, you use these two shortcodes.

First, use pages to create your lessons, then give each a “Menu Order” (this is a standard WordPress feature found in the edit page or quick-edit options). Then use these shortcodes to create links for users to navigate forwards and backward in your lessons:

[wpc_previous_page] [wpc_next_page]

 

You can limit this to only the previous page in a certain course, or only the next page in a certain course, by adding a course tag to the shortcode:

[wpc_previous_page course="Course-Name"] [wpc_next_page course="Course-Name"]

 

There are also options available should you want to add text before or after the link, or add text if you’re at the start or final lesson:

[wpc_previous_page prepend="Before text: " append=" (After text)" not_found="Ready?"] [wpc_next_page prepend="Before text: " append=" (After text)" not_found="That's it!"]

 

You can also use things like “orderby” and “order” in previous/next buttons, like so:

[wpc_previous_page orderby="menu_order" order="asc"] [wpc_next_page orderby="menu_order" order="asc"]

By doing that, you are telling the buttons which page should come next, similar to our list lessons shortcode.

 

You can change the text for navigation links by using button_text:

[wpc_previous_page button_text="New previous text"] [wpc_next_page button_text="New next text"]

Have more questions? Submit a request