Change Archive Post Number for Custom Post Type
Modify the number of WordPress posts or custom posts to be displayed on a custom archive page by adding this filter to your functions.php file in WordPress.
1 2 3 4 5 6 |
function mix_num_posts_for_archive($query) { if ($query->is_main_query() && $query->is_post_type_archive('your-custom-post-name') ) $query->set('posts_per_page', -1); } add_action('pre_get_posts', 'mix_num_posts_for_archive'); |
Change the number of “posts_per_page” to meet your specs, if you … Continued