Title: Infinite Scroll help needed
Last modified: August 21, 2016

---

# Infinite Scroll help needed

 *  Resolved [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/)
 * Im using a custom theme, built with “Blank State.”
 * I’ve added the required code to Activate the Infinite Scrolling to the functions.
   php file.. however, no scrolling happens!
 * Site im working on is located here:
    [http://www.gd-gaming.com/wordpress](http://www.gd-gaming.com/wordpress)
 * Thanks
 * [http://wordpress.org/plugins/jetpack/](http://wordpress.org/plugins/jetpack/)

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/infinite-scroll-help-needed/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/infinite-scroll-help-needed/page/2/?output_format=md)

 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953223)
 * Could you point me to the page listing all your blog posts, as set under Settings
   > Reading in your dashboard?
 * Thanks!
 *  Thread Starter [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953227)
 * The Front Page is set to: “Home” and this contains the post loop.
 * I dont have a “Post-Page” set as I’ve completely customized the theme.
 * If you take another look, I’ve gotten masonry to work with what im doing.. However,
   Infinite-Scroll I am having no luck.
 * Is this something I’m going to need to put in without jetpack since everything
   is customized?
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953229)
 * Ok, I see you have now switched to your custom theme. I can see the posts now.
 * Infinite Scroll will only work on your Posts page and on archive pages ([ref](http://plugins.trac.wordpress.org/browser/jetpack/trunk/modules/infinite-scroll/infinity.php#L869)).
 * If you want Infinite Scroll to be loaded on your static front page as well, you
   will have to add Infinite Scroll support to `is_front_page()`.
 * To do so, you can add the following code to your theme’s functions.php file:
 *     ```
       function tweakjp_custom_is_support() {
       	$supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || is_front_page() );
   
       	return $supported;
       }
       add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' );
       ```
   
 * Once you’ve done so, you can follow this tutorial to make sure Infinite Scroll
   works with JS Masonry:
    [http://wptheming.com/2013/04/jetpack-infinite-scroll-masonry/](http://wptheming.com/2013/04/jetpack-infinite-scroll-masonry/)
 *  Thread Starter [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953230)
 * Awesome, I’ve added the above function.. However, still no luck.
 * I’m curious as to if me not having pagination has anything to do with new elements
   not loading?
 * Or.. Could it be my post loop?
    Or… Do I simply need to follow the link you’ve
   provided?
 * Heres the top portion of my loop:
 *     ```
       global $more;
       $more = 0;
       query_posts('cat=7,8,9,10&posts_per_page=15' );
       if (have_posts()) : while (have_posts()) : the_post(); ?>
       ```
   
 * In any case, I really appreciate the help my friend. I’ve been at this for a 
   day or so to no avail and your help is truly appreciated.
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953274)
 * > I’m curious as to if me not having pagination has anything to do with new elements
   > not loading?
 * This can be caused by different factors, like the number of posts, whether you
   added pagination links or not, or your jQuery Masonry settings.
 * You should be able to get things working with the tutorial I mentioned in my 
   last post.
 * As a sidenote, I would recommend that you use `WP_Query` instead of `query_posts`
   to build your loop. You can read more about it here:
    [http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/](http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/)
 *  Thread Starter [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953282)
 * I’ve added the correct pagination, removed the post feature. Still with no luck.
 * Where exactly do I place the code from the tutorial that you posted to get it
   worked with masonry? Does that go in functions.php?
 *  Thread Starter [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953283)
 * Additionally, I removed the Masonry script to see if that was interfering, infinite
   scroll still did not load additional posts.
 *  Thread Starter [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953289)
 * I may have located the issue: When turning on the debugger, heres what I was 
   greeted with:
 * `
    Notice: Undefined property: WP_Query::$post in /home4/aa/public_html/wordpress/
   wp-includes/query.php on line 3017
 * Notice: Trying to get property of non-object in /home4/aa/public_html/wordpress/
   wp-includes/query.php on line 3385
 * Notice: Trying to get property of non-object in /home4/aa/public_html/wordpress/
   wp-includes/query.php on line 3387
 * Notice: Trying to get property of non-object in /home4/aa/public_html/wordpress/
   wp-includes/query.php on line 3389
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953297)
 * > Notice: Undefined property: WP_Query::$post in /home4/aa/public_html/wordpress/
   > wp-includes/query.php on line 3017
 * You’ll probably need to edit your Post query to solve this issue. You can find
   a lot of examples on this Codex page:
    [http://codex.wordpress.org/Class_Reference/WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query)
 *  Thread Starter [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953303)
 * That seems to have led me on the right track, thanks my friend!
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953341)
 * I see you’ve tried to use Infinite Scroll with Masonry, [but still experience issues](http://wordpress.org/support/topic/jetpack-masonry?replies=2#post-4471457).
 * You used the code provided in the tutorial I linked to earlier, but I still see
   some Javascript errors when browsing your site. These errors seem to be created
   by Masonry:
    [http://i.wpne.ws/QYDg](http://i.wpne.ws/QYDg)
 * You’ll want to make sure that jQuery Masonry is correctly called on your site.
 *  Thread Starter [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953342)
 * Alright heres what I have.
 * **header.php (Placed above the body tag)**
 *     ```
       <script>
       jQuery( document ).ready( function( $ ) {
            infinite_count = 0;
            // Triggers re-layout on infinite scroll
            $( document.body ).on( 'post-load', function () {
       	infinite_count = infinite_count + 1;
       	var $container = $('#content');
       	var $selector = $('#infinite-view-' + infinite_count);
       	var $elements = $selector.find('.hentry');
       	$elements.hide();
       	$container.masonry( 'reload' );
       	$elements.fadeIn();
            });
       });
       </script>
       ```
   
 * **functions.php**
 *     ```
       function my_masonry() {
       	if (!is_admin()) {
       		wp_register_script('jquery_masonry', get_template_directory_uri(). '/js/jquery.masonry.min.js', array('jquery'), '2.0.110526' );
       		wp_enqueue_script('jquery_masonry');
       		add_action('wp_footer', 'add_my_masonry');
   
       		function add_my_masonry() { ?>
       			<script>
       				jQuery(document).ready(function($){
       					$('#content').masonry({
       						itemSelector: 'article',
       					});
       			  	});
       			</script>
       		<?php
       		}
       	}
       }
   
       add_action('init', 'my_masonry');
       ```
   
 * Do you see any issues within either of these?
    Or am I calling the script in 
   the header incorrectly?
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953349)
 * You seem to be using a different code on your site at the moment. I do not see
   any mention of the first code snippet, and the code you created via the `add_my_masonry`
   is different, and does seem to be loaded before `wp_footer`.
 * Could you make sure the code you mentioned above is added properly?
 *  Thread Starter [excessive34](https://wordpress.org/support/users/excessive34/)
 * (@excessive34)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953351)
 * Sorry, I was messing around and tried something different.
 * Everything is back in place, again.. I really appreciate you helping me to resolve
   this.
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/#post-3953352)
 * I don’t seem to be able to access your site at the moment. Could you let me know
   once it’s back up?
 * You might also want to switch to the Twenty Twelve and add only the jQuery Masonry
   to that theme, since it already supports Infinite Scroll.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/infinite-scroll-help-needed/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/infinite-scroll-help-needed/page/2/?output_format=md)

The topic ‘Infinite Scroll help needed’ is closed to new replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

 * 17 replies
 * 2 participants
 * Last reply from: [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-help-needed/page/2/#post-3953356)
 * Status: resolved