How and Where to Add Infinite Scroll Code to TwentyTen-Based Child Theme
-
Hello. I was looking at the Infinite Scroll page at https://jetpack.com/support/infinite-scroll/
Currently, I have been using the WP-Paginate plugin for quite a few years now. However, I am interested in trying out the Infinite Scroll code on my blog at https://www.billkochman.com/Blog/.
I use a slightly modified version of the TwentyTen theme as my child theme. In order to use WP-Paginate, it is necessary to remove a block of code from the top and bottom of my child theme’s “loop.php” file, and replace it with a small function for WP-Paginate.
Do I need to use an unaltered version of the “loop.php” file in order for Infinite Scroll to work properly, or doesn’t that have any bearing on getting Infinite Scroll to work?
Currently, in Jetpack’s settings on the “Writing” page, in the “Theme enhancements” section, under “Infinite Scroll”, it says “Theme support required. Learn more”. So I went to that page and I found the following code for use with TwentyTen. However, the page doesn’t clearly explain where this code should be added. In other words, to what file in my child theme it needs to be added to. I assumed that it might be my child theme’s “functions.php” file, so I added the code to the bottom of that file, and then rebooted my web server. However, nothing is happening. I still just see the page numbering from WP-Paginate:
/** * Add theme support for infinity scroll */ function twenty_ten_infinite_scroll_init() { add_theme_support( 'infinite-scroll', array( 'container' => 'content', 'render' => 'twenty_ten_infinite_scroll_render', 'footer' => 'wrapper', ) ); } add_action( 'after_setup_theme', 'twenty_ten_infinite_scroll_init' ); /** * Set the code to be rendered on for calling posts, * hooked to template parts when possible. * * Note: must define a loop. * function twenty_ten_infinite_scroll_render() { get_template_part( 'loop' ); }
Your assistance in getting this to work would be greatly appreciated. Thanks so much!
The page I need help with: [log in to see the link]
- The topic ‘How and Where to Add Infinite Scroll Code to TwentyTen-Based Child Theme’ is closed to new replies.