Infinite scroll for Travelify WordPress theme using Jetpack

Aigars, I am trying to add support for infinite scroll (Jetpack Plugin).
Therefore I read some tutorials and modified the functions.php of my theme-child as the following:

add_theme_support( ‘infinite-scroll’, array(
‘container’ => ‘main’,
‘footer’ => ‘site-generator’)
);

But nothing happens. Same problem if I copy the code snippet into the original functions.php

Could you help me please? It is documented here: http://jetpack.me/support/infinite-scroll/

It is a bit more tricky than just adding content and footer ID’s for infinite scroll. You need to include render as well with proper WordPress loop for this theme.

Try to adding something like this to your functions.php

	/**
	* Add theme support for Jetpack infinity scroll
	*/
	add_theme_support( 'infinite-scroll', array(
	    'container'	=>	'content',
	    'footer'	=>	'main',
	    'render'	=>	'travelify_theloop',
	));

Let me know if this helps

Yeah, it did work! Thank you very much :slight_smile:

There is only one annoying thing left. The “Previous page” button is still somewhere between the posts. Is there any way to hide it?

This should help:

.home #content ul.default-wp-page {
	display: none;
}

Add this code to Theme Options – Other – Custom CSS or inside style.css for your Child Theme if you use one.

It does work adding it as custom CSS to the parent template. But it does not work when adding it to my child style.css. I do not understand that.

Only thing left is that the dotted line between every post is now missing between the last post of the first page and the first one of the second page. If it is done very easy please assist, but otherwise I don’t mind it!

Thx for your help.

It is a bit tricky. I will eventually release this theme with infinite scroll and will try to address this issue with some decent solution. Stay tuned!