If you want to customize the order of courses on a single course page in LearnPress, follow this step-by-step guide. This method involves using the Post Types Order plugin and adding a custom code snippet to your child theme’s functions.php file.
Step 1: Install the Post Types Order Plugin
You can download the plugin at Post Types Order form WordPress.org
Once installed, go to:
Settings → Post Types Order and enable the “Show” and “Yes” options for all fields.
Step 2: Add Custom Code to Your Child Theme
Next, you’ll need to add a custom filter to modify the course order in LearnPress.
- Navigate to Appearance → Theme File Editor
- Select Theme Functions (functions.php) of your child theme
- Add the following code snippet at the end of the file:
add_filter( 'learn-press/courses/handle_params_for_query_courses', function ( $filter, $param ) {
global $wp_query;
if ( ! isset( $param['order_by'] ) ) {
$wp_order_by = 'menu_order';
$pattern = '/wp_posts./';
$filter->order_by = preg_replace( $pattern, '', $wp_order_by );
}
return $filter;
}, 10, 2 );
Step 3: Reorder Courses with Drag and Drop
After adding the custom code, go to the Courses tab in LearnPress. You can now drag and drop courses to arrange them in your desired order.
The updated order will be reflected on the archive course page, ensuring a better user experience for learners.
Why Optimize Course Order in LearnPress?
- Improved Navigation – Helps students find relevant courses easily
- Better Course Hierarchy – Arrange courses logically to match learning progression
- SEO Benefits – Well-structured course pages improve user engagement and search rankings