Infinite Scroll?

  • My_Pet_Duck

    #6641

    I have tried to activate the Jetpack infinite scroll for the Graphene theme but it says it is not supported. Does anyone know how to get it to work on the Graphene theme?

    Many Thanks

    Josh

    #35135

    Hello,

    Can you please provide a link to the jetpack infinite scroll? I have never heard of this before… should be fun. 🙂

    My_Pet_Duck

    #35136

    Here is a link to the jet pack infinite scroll page. It can be activated through the latest jetpack installations.

    http://jetpack.me/support/infinite-scroll/

    Thankyou

    Prasanna SP

    #35138

    Yeah, it’s pretty much easy. I forgot to answer your question in a similar thread.

    Just add this to your child theme‘s functions.php. (If the functions.php is empty, put the below code after <?php )

    add_theme_support( 'infinite-scroll', array(
    'type' => 'scroll',
    'footer_widgets' => false,
    'container' => 'content-main',
    'wrapper' => true,
    'render' => 'graphene_infinite_scroll_render',
    'posts_per_page' => false
    ) );

    function graphene_infinite_scroll_render() {
    while ( have_posts() ) {
    the_post();
    get_template_part( 'loop', get_post_format() );
    }
    }

    I’ve integrated JetPack Infinite Scroll with Graphene theme in a few of my clients’ sites.

    My_Pet_Duck

    #35139

    Hi Prasanna

    I added the code to my child theme’s functions.php. but now it says the server is down and keeps coming up with the code –

    “HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.”

    Would the infinite scroll code be conflicting with anything and is there a straight forward way of accessing my site again.

    The link is here: http://www.pigtailplus.com

    Thanks

    Prasanna SP

    #35140

    Did you add that code after opening php tag? Also, make sure there isn’t any white space or blank line before opening php tag and add_theme_support.. It works fine in many of my sites.

    NorysLintas

    #35141

    Hi today i modified my function.php theme in a test site, but as you can see, “older post” remain.

    http://filmandnovel.pusku.com

    What i have to do?

    Here is my function php code

    <?php
    add_theme_support( 'infinite-scroll', array(
    'type' => 'scroll',
    'footer_widgets' => false,
    'container' => 'content-main',
    'wrapper' => true,
    'render' => 'graphene_infinite_scroll_render',
    'posts_per_page' => false
    ) );

    function graphene_infinite_scroll_render() {
    while ( have_posts() ) {
    the_post();
    get_template_part( 'loop', get_post_format() );
    }
    }

    /**
    * Graphene WordPress Theme, Copyright 2010-2012 Syahir Hakim
    * Graphene is distributed under the terms of the GNU GPL version 3
    *
    * Graphene functions and definitions
    *
    * @package Graphene
    * @since Graphene 1.0
    */

    /**
    * Before we do anything, let's get the mobile extension's init file if it exists
    */
    $mobile_path = dirname( dirname( __FILE__ ) ) . '/graphene-mobile/includes/theme-plugin.php';
    if ( file_exists( $mobile_path ) ) { include( $mobile_path ); }

    /**
    * Load the various theme files
    */
    global $graphene_settings;
    require( get_template_directory() . '/admin/options-init.php' ); // Theme options and admin interface setup
    require( $graphene_settings['template_dir'] . '/includes/theme-scripts.php' ); // Theme stylesheets and scripts
    require( $graphene_settings['template_dir'] . '/includes/theme-utils.php' ); // Theme utilities
    require( $graphene_settings['template_dir'] . '/includes/theme-head.php' ); // Functions for output into the HTML <head> element
    require( $graphene_settings['template_dir'] . '/includes/theme-menu.php' ); // Functions for navigation menus
    require( $graphene_settings['template_dir'] . '/includes/theme-loop.php' ); // Functions for posts/pages loops
    require( $graphene_settings['template_dir'] . '/includes/theme-comments.php' ); // Functions for comments
    require( $graphene_settings['template_dir'] . '/includes/theme-widgets.php' ); // Functions for custom widgets
    require( $graphene_settings['template_dir'] . '/includes/theme-slider.php' ); // Functions for the slider
    require( $graphene_settings['template_dir'] . '/includes/theme-panes.php' ); // Functions for the homepage panes
    require( $graphene_settings['template_dir'] . '/includes/theme-plugins.php' ); // Native plugins support
    require( $graphene_settings['template_dir'] . '/includes/theme-shortcodes.php' ); // Theme shortcodes
    require( $graphene_settings['template_dir'] . '/includes/theme-webfonts.php' ); // Theme webfonts
    require( $graphene_settings['template_dir'] . '/includes/theme-functions.php' ); // Other functions that are not categorised above
    require( $graphene_settings['template_dir'] . '/includes/theme-setup.php' ); // Theme setup

    Thanks for your help 🙂

    Prasanna SP

    #35142

    Do not edit parent theme files. It brings you a lot of headache. You’ll also lose your modifications when you update the theme. Add the above code to child-theme’s functions.php. Or, you can use this plugin created by me – https://github.com/prasannasp/graphene-infinite-scroll#infinite-scroll-helper-plugin-for-the-graphene-theme

    Quote:
    but as you can see, “older post” remain.

    Oh! Yeah, here you go. Add this to custom CSS if you don’t want to use that plugin.

    /* Hides navigation links when infinite scroll is active */
    .infinite-scroll .post-nav, .infinite-scroll .wp-pagenavi {
    display: none !important;
    }

    /* Add some margin to Load more posts div */
    .infinite-scroll #infinite-handle {
    margin-top: 20px;
    margin-bottom: 5px;
    }

    NorysLintas

    #35143

    Many thanks for your patience

    Your plugin works well 😉

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.