How to have more than 5 courses on the new Memberpress Course Hub page (NHP 2.0)

How to have more than 5 courses on the new Memberpress Course Hub page (NHP 2.0)

To watch this video directly: https://vimeo.com/473700188





Here is the code to use:

‚Äč

function num_posts_course_archive($query){

if (is_post_type_archive( 'mpcs-course' )) {

$query->set('posts_per_page', '12');

$query->set('order', 'ASC');

$query->set('orderby', 'title');

}

return $query;

}


add_filter('pre_get_posts', 'num_posts_course_archive', 100);