Support » Plugin: Infinite-Scroll » [Plugin: Infinite-Scroll] query vars changed via pre_get_posts not respected by infinite scroll

  • Resolved helgatheviking

    (@helgatheviking)


    posted on github, reposting here:

    i’ve modified my main query to add a second post type

    function add_external_videos_to_query( $query ) {
    
        if ( is_main_query() && is_home() )
            set_query_var ( 'post_type', array('post','external-videos') );
    }
    add_action( 'pre_get_posts', 'add_external_videos_to_query' );

    without the infinite scroll plugin enabled (Version 2.0b2.120226) visiting pages 2, 3, etc show mixed posts of both post type as expected. however, when using infinite scroll, posts of other post types do not appear in the added content.

    https://github.com/paulirish/infinite-scroll/issues/77 implies that the pre_get_posts filter should work fine w/ infinite scroll, but i am not experiencing 404s on the paged pages, i’m just not seeing the second post type… in this case ‘external-videos’.

    infinite scroll goes to the next page and scrapes the data from a specific div, but it seems like the pre_get_posts filter is not being run. i

    what hook does the infinite scroll run on? what logic should be used so that the infinite scroll requests also run the filter?

    http://wordpress.org/extend/plugins/infinite-scroll/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Infinite-Scroll] query vars changed via pre_get_posts not respected by infinite scroll’ is closed to new replies.