Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter JohnnyW

    (@johnnyw)

    Agh. Turns out that it was an issue with the W3TotalCache plugin. My bad. WP Mobile Detect is working fine again now.

    Thread Starter JohnnyW

    (@johnnyw)

    BTW – I’m using a Custom Post type… that shouldn’t be the issue, should it?

    Thread Starter JohnnyW

    (@johnnyw)

    I haven’t tried what you’ve suggested, as I don’t completely know how to implement that in the way you’ve mentioned, but could I ask: How can I tell if Jetpack Infinite Scroll has fired correctly? There must be an AJAX call being made, even if it returns nothing, but I can’t see anything in Developer Tools.

    If that’s firing correctly, then maybe I can figure out why it’s not getting the right content.

    Thanks again for your assistance.

    Thread Starter JohnnyW

    (@johnnyw)

    Sent a request via the form. Thanks!

    Thread Starter JohnnyW

    (@johnnyw)

    Hi Jeremy, I use Bones. I’ve rewritten my code a little, as I believe there were some odd things in it:

    /************* INFINITE SCROLL **************/
    
    function bones_infinite_loop_init(){
    	add_theme_support( 'infinite-scroll', array(
    	    'type'           => 'click',
    		'container'      => 'masonry',
            'render'         => 'bones_infinite_scroll_render'
    	) );
    }
    add_action( 'init', 'bones_infinite_loop_init' );
    
    function bones_infinite_scroll_render() { ?>
        <?php $args = array( 'post_type'=> 'wigwam','post_parent' => 0,'posts_per_page' => 25);
            query_posts( $args );
        if (have_posts()) : ?>
            <?php while (have_posts()) : the_post();
                get_template_part( 'content' );
            endwhile; ?>
        <?php endif; ?>
    <?php
    } ?>

    Thanks for attempting to help.

    Thread Starter JohnnyW

    (@johnnyw)

    Here’s the longer version of what I’ve tried:

    I have carefully followed these instructions at OttoPress (http://ottopress.com/2012/jetpack-and-the-infinite-scroll/), and read all the documentation at Jetpack.me. I feel like I understand what should work, but for some reason Infinite Scroll is not firing.

    I have installed Jetpack onto my WordPress installation and disabled all features apart from Infinite Scroll.

    I created a content.php, as per the recommendations at OttoPress, and my page (page-news.php) loads that content just fine, and as I’d expect. The code looks like this:

    <div id="masonry">
    <?php while (have_posts()) : the_post();
    get_template_part( 'content', get_post_format() );
    endwhile; ?>
    </div>

    With that all working correctly, I then added the following to functions.php:

    function bones_infinite_loop_init(){
    add_theme_support( 'infinite-scroll', array(
    'footer' => false,
    'type' => 'scroll',
    'footer_widgets' => false,
    'container' => 'masonry',
    'wrapper' => false,
    'posts_per_page' => false
    ));
    }
    add_action( 'init', 'bones_infinite_loop_init' );

    When that didn’t work, I even tried adding:

    'render' => 'bones_infinite_scroll_render',

    And created a function with the post formatting in it.

    I’ve also tried:

    'type' => 'click'

    But nothing appears on the page, no extra posts are loaded when I scroll to the end of the page, and infinite-scroll does not appear as a class on the body element.

    The are also no errors in the developer console. There are no errors when I set WP_DEBUG to true. I’ve also tried disabling all other plugins.

    What am I missing?

    I’m wondering if it’s to do with any of the following:

    1. I’m trying infinitely scroll Custom Posts
    2. On page-news.php I have 'posts_per_page' => 3 and maybe that’s conflicting somehow?
    3. I’ve missed a crucial (but obvious) step in setting things up

    Thanks for any help.

Viewing 6 replies - 1 through 6 (of 6 total)