• Hey,

    I am trying to get Jetpack Infinite Scroll working on my website and I’m not having much joy…

    I added the following to my functions.php file

    add_theme_support('infinite-scroll', array(
        'type'			=> 'click',
        'container'		=> 'postwrap'
    ));

    Then created a content.php file with the loop in:

    <?php get_header(); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div id="blog-post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<?php if(is_sticky()){ ?>
        	<div class="featured_sticky"></div>
        <?php } ?>
        <div class="inner">
        	<h1><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
        	<p class="meta"><?php the_time('jS F'); ?>&nbsp;&nbsp;//&nbsp;&nbsp;<a href="<?php comments_link(); ?> "><?php comments_number( '0 Comments', '1 Comment', '% Comments' ); ?></a>&nbsp;&nbsp;//&nbsp;&nbsp;<?php the_category(', '); ?></p>
    
    		<?php
            if(has_post_thumbnail()) {
                $feat_img_id = get_post_thumbnail_id($post->ID);
                $feat_image = wp_get_attachment_image_src($feat_img_id, 'featured');
                $feat_alt_text = get_post_meta($feat_img_id , '_wp_attachment_image_alt', true);
    
                echo "<a href=\"".get_permalink()."\"><img src='" . $feat_image[0] . "' class='featured' alt='". $feat_alt_text ."' /></a>";
            }
            ?>
    
        	<?php the_content(); ?>
        </div>
    </div>
    
    <?php endwhile; endif; ?>
    
    <div class="clear"></div>
    
    <?php get_footer(); ?>

    But it just wont work? Am I doing something wrong or what? :S

    Thanks,
    Dan

Viewing 1 replies (of 1 total)
  • Thread Starter Danny159

    (@danny159)

    Got the load more button coming up now… but when you click it it spins and no posts are loaded?

Viewing 1 replies (of 1 total)
  • The topic ‘Jetpack Infinite Scroll’ is closed to new replies.