Below code will automatically add infinite scroll in your WordPress site, first you need install the Jetpack plugin in order to enable infinite scroll feature in your WordPress site.
Open you theme’s functions.php file and add the below code or you can also add the below code if you are using any site-specific plugin.
add_theme_support( 'infinite-scroll', array(
'container' => 'content',
'footer' => 'page',
That’s all, I hope this helped you!
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.