Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Could you let me know the code you used to add Infinite Scroll support to your theme?

    Thanks!

    Thread Starter Rommel Castro

    (@rommelxcastro)

    hey @jeherve,

    add_theme_support( 'infinite-scroll', array(
    		'container'      => 'portfolioitems',
    		'footer'         => false,
    		'render'         => 'genesis_do_loop',
    		'posts_per_page' => 12
    	) );

    IS being used for custom post types archives

    I have same issue… load 2 post, only the first, pagination not working.

    functions.php

    function yogobierno_infinite_scroll_init() {
    	add_theme_support( 'infinite-scroll', array(
    	    'container'  => 'content',
    	    'type' => 'scroll',
    	    'footer' => false,
    	    'render' => 'render_function',
    	    'wrapper' => false,
    	    'posts_per_page' => false,
    	) );
    }
    add_action( 'init', 'yogobierno_infinite_scroll_init' );
    
    function render_function() {
        get_template_part('content', get_post_format());
    }

    index.php

    get_template_part( 'content', get_post_format() );

    content.php

    <?php // Posts
    $paises = wp_get_post_terms( $post->ID, 'pais' , array("fields" => "all") );
    $pais = $paises[0];
    $term_name = $pais->name;
    
    $categories = get_the_category( $post->ID);
    $cat = $categories[0];
    $catEng = get_field('traducciontopico', 'category_'.$cat->term_id);
    ?>
    <div class="historia-box" onclick="window.location = '<?php get_permalink() ?>';">
    	<div class="historia-excerpt">
    		<p><?php echo limit_string_char(get_the_excerpt()); ?></p>
    	</div>
    	<div class="historia-content">
    <span class="historia-categoria"><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> <?php _ts($cat->name, $catEng); ?> | <?php _ts( get_the_date( 'd M' ) , get_the_date( 'm / d  / y' ) ); ?></span>
    		<h1><?php echo limit_string_char(get_the_title(),56); ?></h1>
    
    <ul>
    			<?php
    			$posttags = get_the_tags();
    			if ($posttags) {
    			  foreach($posttags as $tag) { ?>
    
    <li><a href="#"><?php echo $tag->name; ?></a></li>
    			    <?php }
    			}
    			?>
    		</ul>
    	</div>
    </div>

    Thread Starter Rommel Castro

    (@rommelxcastro)

    no clue around this?

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    @rommel Sorry, I’ve been sick for the past few days. Looking into this now.

    Could you let me know the contents of the genesis_do_loop function?

    @dgwoodstock Could you please start your own thread, as per the Forum Welcome?
    https://www.ads-software.com/support/plugin/jetpack#postform

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘IS loading first page twice.’ is closed to new replies.