WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Infinite Scroll and custom page template issues (15 posts)

  1. lukehm
    Member
    Posted 1 year ago #

    I have a custom page template that outputs an archive of posts using query_posts. Is it possible to get the jetpack infinite scroll to work on these pages? It works great on my blog and standard category pages.
    Many Thanks
    Luke

    http://wordpress.org/extend/plugins/jetpack/

  2. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    You must use a standard WordPress loop. See http://jetpack.me/support/infinite-scroll/

    You shouldn't use query_posts. Check out this presentation:
    http://wordpress.tv/2012/06/15/andrew-nacin-wp_query/

  3. lukehm
    Member
    Posted 1 year ago #

    should I create new WP_Query then?
    The Query is on a custom page template called milestone.php do I need to do any thing with
    private function archive_supports_infinity() {
    return (bool) apply_filters( 'infinite_scroll_archive_supported', ( is_home() || is_archive() ), self::get_settings() );
    }

    As it is not an archive page
    Many Thanks
    Luke

  4. Erick Hitter
    Member
    Plugin Author

    Posted 1 year ago #

    At this time, Infinite Scroll doesn't support custom queries within page templates. The module interacts with, and depends on, the main query, which in your case is the query that retrieves the requested page and its custom template.

    This is a great suggestion and something we'll consider for a future release.

  5. grosbouff
    Member
    Posted 1 year ago #

    +1 for this feature !
    I use the plugin "The Loops" to display posts on pages and I would like to be able to use the infinite scroll with it.
    If the Jetpack query could be filtered, it would be nice.

  6. aguidis
    Member
    Posted 1 year ago #

    +1 :)

    I'm using WP_Query() on my custom template and I need the infinity scroll on this page ^^

  7. Erick Hitter
    Member
    Plugin Author

    Posted 1 year ago #

    Support for additional WP_Query instances within a page template will require an overhaul of the current Infinite Scroll code. It is something we may consider for a future release, but currently there isn't a timeframe for that consideration.

  8. mrjgardiner
    Member
    Posted 1 year ago #

    One more request for the Infinite Scroll on custom page templates.

  9. jrgiblette
    Member
    Posted 1 year ago #

    Another request for infinite scroll on custom wp queries. Please?

  10. ludoamaral
    Member
    Posted 1 year ago #

    sometimes we can't chose between infinite scroll and custom queries, we just need both. so +1 for this feature asap!

  11. andy999
    Member
    Posted 1 year ago #

    We need this feature ASAP!

    The ability to use custom queries and possibly have multiple 'infinite scroll' loops on a page (a sidebar and the main content area for example) would open up a world of possibilities.

    Please please do this!

  12. ngoodfellow
    Member
    Posted 11 months ago #

    I agree! I use a custom code to randomize paged posts and I would like to be able to pass the order parameter to infinite scroll.

    How can I contribute to getting this feature?

    my website is:
    http://zombieprepkit.com/

  13. ngoodfellow
    Member
    Posted 11 months ago #

    After doing some testing it appears as though this is how things load with infinite scroll on my site with random post order displayed as default=

    Default Home Page - Loads Content Properly for this as page 1
    Infinite Scroll - Paged 1 - reloads content properly with this as page 1
    Infinite Scroll - Paged 2 - reloads content properly with this as page 2
    Infinite Scroll - Paged 3 - reloads content properly with this as page 3

    so... is there a way to, when using infinite scroll, force it to load the page through infinite scroll for the first loop and continue from there?

    I will leave the example on http://zombieprepkit.com/?order=date for a day or two before I disable it again.

    I can provide the code that randomizes things if needed but its using a form that submits values to be used in a query_posts() array
    things are set by default to random and random posts are paged with a edit_posts_orderby statement that allows paged random posts to work... until Infinite Scroll is enabled!

    I tried actually replacing
    get_template_part( 'loop', 'index' );
    in my theme index file with:
    twenty_ten_infinite_scroll_render();

    but this didn't seem to work, still the first page seems to load 2x in and then everything else loads properly

  14. designsimply
    Member
    Plugin Contributor

    Posted 11 months ago #

    @ngoodfellow, it sounds like you're looking for some custom code help that's beyond the scope of plugin support. You might consider hiring help from a company such as WerkPress to see if what you want to do (or something similar) is possible without the overhaul of the Infinite Scroll code which would be required and which isn't currently a planned update for the near future.

  15. ovolatier
    Member
    Posted 9 months ago #

    Guys,

    In the file infinite-scroll.php

    in Function shouldLoadJavascript() {

    Replace

    if (is_singular()) {
    return false;
    }

    by

    if (is_singular()) {
    return true;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic