I’ve created a custom WordPress theme for a client and am trying to utilize Jetpack’s infinite-scroll feature but cannot get it to work. I’m relatively new to WordPress, but have spent hours trying to resolve this.
Here is a link to the site as is:
http://wpportmanteau.cityonfilm.com/
I’ve added theme support for infinite scroll in my functions.php file
<?php
add_theme_support( 'post-thumbnails' );
add_theme_support( 'infinite-scroll', array(
'type' => 'scroll',
'footer_widgets' => false,
'container' => 'content',
'wrapper' => true,
'render' => false,
'posts_per_page' => false,
) );
?>
I’m using the get_template_part function as per this article:
http://ottopress.com/2012/jetpack-and-the-infinite-scroll/
The content.php file generating the posts is as follow:
<?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
<div class="window preview">
<div class="poster preview" style="background: url(<?php echo $url; ?>); background-size:cover;">
<h2><?php the_time('m/d'); ?></h2>
</div>
<div class="info preview">
<div class="postInfo">
<a href="<?php the_permalink(); ?>"><h1><?php the_title(); ?></h1></a>
<p> <?php the_tags('',' / ',''); ?> </p>
<?php echo sharing_display(); ?>
</div>
<div class="toolbar">
<a target="_blank" class="large button" href="<?php echo get_post_meta($post->ID, 'Download', true); ?>" title="Download"><img src="<?php bloginfo('template_url'); ?>/images/dl.png"></a><a class="large button" href="<?php echo get_post_meta($post->ID, 'Stream', true); ?>" title="Stream"><img src="<?php bloginfo('template_url'); ?>/images/stream.png"></a>
</div>
</div>
</div>
I know that the structure of my posts is a little strange but I’m not having any trouble generating them.
Thanks in advance for any advice/support. Let me know if I can provide any more information to clarify.
You need to most likely need to define the render parameter. So would define the get_template_part. Jetpack uses
get_template_part( 'content', get_post_format() );
by default but if your theme uses a different file names or template part location then you will need to define it.http://www.hongkiat.com/blog/wordpress-infinite-scroll/
http://jetpack.me/support/infinite-scroll/