I would like to add jetpack infinity scroll to my webpage.
Unfortunately the div which contain all post, not have ID
only class
have him, so I added ID
with php:
if ( is_home() ) {
$homepagepostsid="posts-content";
}else{
$homepagepostsid="";
}
HTML:
<div id="<?php $homepagepostsid ?>" class="loop-container loop-container--wp <?php echo esc_attr($loop_classes); ?>">
</div>
As you can see, I tried to reach something like this in some world:
If you're on home page, php add a id to loop-container loop-container--
div, else the id value is empty.
Unfortunately in somehow this doesn't work, because the infinity scroll trying to load posts to wp-admin area, which loos like this:
.
:
On the top this text can be found:
"The comments closed"
And the chrome inspector also it confirm that hypothesis , which I mention before.
.
:
.
:.
:
The page trying to load the posts to wp admin area.
How can I fix this?
My jetpack infinity scroll code in functions.php:
function zilla_infinite_scroll_render() {
}
get_template_part( 'loop_item', 'standard' );
add_theme_support( 'infinite-scroll', array(
'container' => 'posts-content',
'render' => 'zilla_infinite_scroll_render',
'type' => 'scroll',
));