Support » Plugin: Infinite-Scroll » Infinite Scroll on home page with multiple loops

  • Resolved S3nd41

    (@s3nd41)


    Hello,

    I was wondering if it’s possible to implement inifnite scrolling on multiple loops on my blog’s main page that would load posts Twitter style, by clicking a link below each section.

    Here’s my code:

    <?php
    	global $post;
    	$post_photos = get_posts('post_type=post&numberposts=20&category=421');
    	$post_videos = get_posts('post_type=post&numberposts=20&category=422');
    ?>
    
    <?php get_header(); ?>
    
    <?php get_sidebar(); ?>
    
    <div class="floater_top">
    
    <?php if (have_posts()) : ?>
    
    <!-- PHOTO GALLERY START -->
    
    <div id="photogallery"></div>
    <div class="subfloater">
    
    <h1>Photos</h1>
    <h3>Subtitle</a></h3>
    
    				<?php foreach($post_photos as $post) :
    					setup_postdata($post);	?>
    
    <a href="<?php the_permalink(); ?>">
    <div class="photos_big_outside">
    <div class="photos_big_inside" ><?php get_post_image ('w=140&h=210&zc=T&q=95'); ?></div>
    </div><!-- end photos_big_outside -->
    </a>
    
    				<?php endforeach; ?>
    
    <div class="subfloater_footer_txt">
    <h3><a>Press Here to Load More Photos</a></h3>
    </div><!-- end subfloater_footer_txt -->
    </div><!-- end subfloater -->
    
    <!-- PHOTO GALLERY END -->
    
    <!-- VIDEO DEPOT START -->
    
    <div class="subfloater">
    <div id="videodepot"></div>
    <h1>Videos</h1>
    <h3>Subtitle</h3>
    
    				<?php foreach($post_videos as $post) :
    					setup_postdata($post);	?>
    
    <div class="videos"><h1><?php echo get_the_title($ID) ?></h1></div>
    
    				<?php endforeach; ?>
    
    <div class="subfloater_footer_txt">
    <h3><a>Press Here to Load More Videos</a></h3>
    </div><!-- end subfloater_footer_txt -->
    </div><!-- end subfloater -->
    
    <!-- VIDEO DEPOT END -->
    
    </div><!-- end floater_top -->
    
    			<?php else : ?>
    
    			<?php endif; ?>
    
    <?php get_footer(); ?>

    If someone can help me figure out the selectors I’d appreciate it also, I’m not too experienced with that.

    Thanks in advance!

    http://wordpress.org/extend/plugins/infinite-scroll/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor beaver6813

    (@beaver6813)

    Hi S3nd41,
    Unfortunately the wordpress plugin doesn’t currently support multiple instances of it running though its definitely something I can look at for the future. (The javascript plugin does support it but its quite complicated to implement: https://github.com/paulirish/infinite-scroll)

    Selector wise, you’re best out checking out the short guide I just wrote on how to figure them out:
    http://beaver6813.com/2012/01/selectors-in-infinite-scroll/

    Thread Starter S3nd41

    (@s3nd41)

    Thanks for your reply.

    I will take a shot at the Jquery version of your script and thanks for the great visual guide, I can’t zoom in on the image you have on your main website so that will be helpful!

    Hi S3nd41!
    How did you do it ? I have the same problem…two loops on same page, on is for frontpage, on sidebar i want the manual trigger, in the center the automatic one. On sidebar always shows the first 3 posts ( the post_per_page is set to 3 in this loop)..

    Thread Starter S3nd41

    (@s3nd41)

    @moncsoka: I ended up not trying it since the developer said that it was “quite complicated to implement”, I thought it would be too time consuming so I went for a normal pagination approach.

    @beaver6813

    Unfortunately the wordpress plugin doesn’t currently support multiple instances of it running though its definitely something I can look at for the future.

    Hi, has any work been done on enabling multiple instances/selectors?

    I have been trying .selector1, .selector2 over content/posts selectors and cannot get it working.

    Would a solution be to wrap any infinity desired sections up in matching tags so it all works off the same selectors ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Infinite Scroll on home page with multiple loops’ is closed to new replies.