1 comments

@nmr 2019-05-13 18:49:03

"Posts per pages" limit from "Settings -> Reading" does not apply here (post list in the dashboard) and default size of list is 20.

Your pagination does not work properly because you use pre_get_posts action hook to change the per_page limit, which is not the right way. The per_page limit overwritten by pre_get_posts filter will only work in some situations (it will not work, for example, for hierarchical types) and it will affect number of posts fetched from DB, but in pagination original per_page value will be used.

Posts per page in dashboard

To change the number of posts per page for the lists in a dashboard, use hooks:

add_filter('edit_hep_faq_per_page', 'se337791_hepfaq_posts_per_page');
function se337791_hepfaq_posts_per_page( $posts_per_page )
{
    return 10;
}

// -- OR --
add_filter('edit_posts_per_page', 'se337791_posts_per_page', 20, 2);
function se337791_hepfaq_posts_per_page( $posts_per_page, $post_type )
{
    if ( 'hep_faq' == $post_type )
        return 10;
    return $posts_per_page;
}

Related Questions

Sponsored Content

Sponsored Content