• Resolved Bill Kochman

    (@wordweaver777)


    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!

    • This topic was modified 5 years, 1 month ago by Bill Kochman.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor James Huff

    (@macmanx)

    You may need to try with an unaltered load.php file, we can’t really support customizations of that extend.

    If the code added to the functions.php file didn’t work, try a functionality plugin instead, like https://www.ads-software.com/plugins/code-snippets/

    Thread Starter Bill Kochman

    (@wordweaver777)

    Hello James. Thanks for your response.

    First, I was not familiar with the “load.php” file. Conducting a search found a copy of it in the “wp-includes” folder. To my knowledge, I have never altered that file. I also found a “load.php” file in the “wp-useronline” plugin folder. Whether or not that is affecting Infinite Scroll, I really do not know, but I don’t wish to sacrifice that plugin just to get Infinite Scroll working.

    I downloaded and installed the “Code Snippets” plugin as you suggested. After that, I created a new snippet, and pasted in the code, exactly as you see it in my previous post. I don’t know if this means anything or not, but the last two opening and closing brackets — not the parentheses — in `{
    get_template_part( ‘loop’ );
    }` where highlighted in yellow for some reason.

    At any rate, Infinite Scroll was still not working, even after doing that.

    I wondered if the “WP-Paginate” plugin might be interfering with Infinite Scroll, so I deactivated it. Still no Infinite Scroll.

    Lastly, I replaced my altered “loop.php” file in my child theme, with a virgin copy of the same file. Still no Infinite Scroll.

    At this point, I guess I could go the long route and deactivate all third party plugins, reactivate them one at a time, and see if Infinite Scroll finally works. However, I am not that desperate to have Infinite Scroll, so I will just leave things as is, and continue to use WP-Paginate.

    Oh, BTW, Jetpack’s “Related Posts” functionality doesn’t appear to be working either … unless it just works on newly-added posts, and not on older posts. Anyway, I disabled it in Jetpack.

    Again, thanks for your time.

    Plugin Contributor James Huff

    (@macmanx)

    Hm, that should have worked.

    Please contact us via https://jetpack.com/contact-support/?rel=support so we can take a closer look.

    Thread Starter Bill Kochman

    (@wordweaver777)

    James, don’t worry about it. As I said, I can do without Infinite Scroll and Related Posts. It is just not worth the time or hassle on my part. My blog works fine without both. Thanks for your time and assistance. Much appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How and Where to Add Infinite Scroll Code to TwentyTen-Based Child Theme’ is closed to new replies.