Enable infinite scrolling in our media library
Updated 5 days ago
WordPress introduced the infinite media loading filter in our media library starting with version 5.8, and as of version 7.1, infinite loading is enabled by default again.
However, if we are used to it and do not mind consuming a little more data, we can easily enable it without installing any plugin or reloading our application, allowing us to browse all our images without pagination.
To do this, we add the following code to our functions.php:
add_filter( 'media_library_infinite_scrolling', '__return_true' );If we do not have a child theme, or want to avoid modifying files, we can use Fluent Snippets, the lightest and simplest plugin for adding this type of functionality or additional code to our site.
We add a new snippet, selecting the default Snippet type: Functions PHP, and complete it with the code mentioned above.