Admin is showing all posts on page 1

I have 900 media items on the site. For some reason the pagination has stopped working in a few sites and all the posts

I have 900 media items on the site. For some reason the pagination has stopped working in a few sites and all the posts are being shown slowing down the site a lot. This happens on the Media library (/wp-admin/upload.php) and admin Posts list page too (/wp-admin/edit.php).

I've disabled all plugins. Posts per page is set as 20 via settings > reading.

I'm printing the query using a pre_get_posts - print_r($wp_query); and its says posts per page = 20.

Seems like the posts per page is getting messed up somehow? Any help appreciated.

I have 900 media items on the site. For some reason the pagination has stopped working in a few sites and all the posts are being shown slowing down the site a lot. This happens on the Media library (/wp-admin/upload.php) and admin Posts list page too (/wp-admin/edit.php).

I've disabled all plugins. Posts per page is set as 20 via settings > reading.

I'm printing the query using a pre_get_posts - print_r($wp_query); and its says posts per page = 20.

Seems like the posts per page is getting messed up somehow? Any help appreciated.

Share Improve this question asked Sep 11, 2015 at 14:59 v3ntv3nt 1,6897 gold badges36 silver badges54 bronze badges 7
  • Maybe something in your theme that's interfering? – birgire Commented Sep 11, 2015 at 15:05
  • i've had a good look and i'm certain the only theme file that can affect the admin is the functions.php. And i've searched theme wide for a posts_per_page setting. And at the top of the admin page that's showing ALL of the items its says in the spat out $wp-query 'posts_per_page' =>20. – v3nt Commented Sep 11, 2015 at 15:08
  • 1 You could try a default theme, just to be sure (remember to backup first) or you might have mu-plugins ? – birgire Commented Sep 11, 2015 at 15:09
  • Did you check your Screen Options for the media and posts page? It's the small tab in the upper right of the screen that readds "Screen Options", clicking on it will reveal a form that allows you to configure the number of items displayed on that page. – totels Commented Sep 11, 2015 at 15:10
  • screen options say 20 too. – v3nt Commented Sep 11, 2015 at 15:18
 |  Show 2 more comments

1 Answer 1

Reset to default 0

so it was $wp_query->set('nopaging', true);

Which was set in a pre_get_posts function. I never thought of searching for this.

I've added

if(!is_admin()){
// code
}

So it doesn't run in the admin.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745106137a4611566.html

相关推荐

  • Admin is showing all posts on page 1

    I have 900 media items on the site. For some reason the pagination has stopped working in a few sites and all the posts

    8小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信