Enable infinite scrolling in our media library
Updated 2 months ago
WordPress introduced the infinite media loading filter in our media library in version 5.8, and infinite loading has been enabled by default again since version 7.1.
But if we're used to it and don't mind using a little more data, we can easily enable it without installing a plugin or reloading our application, so we can 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 don't 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 function or additional code to our site.
We add a new snippet, select the default Snippet type: Functions PHP, and enter the code mentioned above.
Was this helpful?
Was this helpful?