最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to limit the amount of images uploaded to the media library within post.php

programmeradmin10浏览0评论

Over time, the media gallery gets heavier and heavier. I noticed that in admin-ajax.php the wp brings 40 images in a single query, it is taking too long to render the images on the screen, sometimes more than 50 seconds.

How could you reduce these consultations to 10? And when scrolling, continue loading the other images every 10

I found this piece of code

add_filter ('ajax_query_attachments_args', function ($ query) { $ query ['number_posts'] = 10 return $ query; });

However, it only lists the first 10 images and I can't see the rest, it doesn't have a page or scroll.

There is already a whole job of optimizing the image

Print: .png

发布评论

评论列表(0)

  1. 暂无评论