Custom post type with 2.5 (3 posts)

  1. ExoGenesis
    Posted 3 years ago #

    I managed to get infinite scroll working with my site using the workaround detailed here when using the older version of infinite scroll but since I updated to 2.5 it no longer works. In the release notes it said that support for custom post types had been added which was one of the main reasons I updated.

    I have tried removing the code from functions and it doesn't seem to make a difference. I know the selectors are right because it works on other pages on the site like the search page.

    http://sc2melee.net/maps/ - doesn't work
    http://sc2melee.net/maps/recently-added/ - doesn't work
    http://sc2melee.net/?s=tpw - works

    Anyone got any ideas?


  2. Glenn Nelson
    Plugin Author

    Posted 3 years ago #


    FWIW, there were a few bugs in the 2.5 release, so I would first recommend upgrading to the 2.6 release.

    Regarding the issue of Infinite-Scroll not working, on the first two broken pages, the plugin appears to not be loading because the code that writes it out to the page isn't called.

    Can you tell me what the post types for three pages are?

  3. ExoGenesis
    Posted 3 years ago #

    Hi Glenn

    I have now updated the plugin but the infinite scroll still isn't working.

    Perhaps I am not using a custom post type. The 'maps' and 'recently added' pages are made using a page template which queries the loop

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
    	'category_name' => 'maps',
    	'posts_per_page' => 20,
    	'paged' => $paged,
    	'gdsr_sort' => rating,
    	'sort_order' => desc,

    and then includes the loop

    <?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    						/* Include the Post-Format-specific template for the content.
    						 * If you want to overload this in a child theme then include a file
    						 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    						get_template_part( 'content-map', get_post_format() );
    				<?php endwhile; ?>
    				<?php echo paginate_links( $args ) ?>
    				<?php toolbox_content_nav( 'nav-below' ); ?>

    As you can see it uses a Post-Format-specific template.

    I'm not sure what the problem is here though because it worked before by including

    function my_load_infinite_scroll( $load_infinite_scroll ) {
        if( is_page( array('maps','recently-added')) )
            return true;
        return $load_infinite_scroll;
    add_filter('infinite_scroll_load_override', 'my_load_infinite_scroll');

    in functions.php. It works on the other pages (such as search) but not on maps or recently added.

    Any ideas where I am going wrong? I think I will have to go back to the older version of the plugin at this rate.


    Look like it is a problem with loading it on page templates, others seem to be having the same issue :(

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Infinite-Scroll
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic