WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Lopps + Endless Scrolling (1 post)

  1. ddzaks
    Member
    Posted 1 year ago #

    Hi all,
    I've been trying to get this to work for a while and can't really find the way it's done.

    Here is the site that does what I want to do: http://thepostfamily.com/
    Here's my attempt: http://lab.diegozaks.com

    The way i'm organizing the site's content is displaying one category in the experiments column and all other posts in the research column. What I did was created two loops and called them in the index:

    index.php:

    <?php get_header();
    	if ( ! isset( $content_width ) ) $content_width = 480;
    
    ?>
    <div class="doubleloop">
    	<div class="experiments">
       <? include('loops/experimentloop.php') ?>
        	</div>
      <div class="research">
       <? include('loops/researchloop.php') ?>
      </div>
    <? include('footer.php') ?>

    Loop1:

    <?php
     global $post;
     $myposts = get_posts('&category=51');
     foreach($myposts as $post) :
       setup_postdata($post);
     ?>
    			<div class="PostContainer">
    				<div class="PostTitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></div>
                    <div class="PostDate">On <?php the_date(); ?></div>
                    <div class="PostContent">
                        <?php the_content(); ?>
                	</div>
    			</div>
     		<?php endforeach; ?>

    and Loop 2

    <?php
     global $post;
     $myposts = get_posts('&category=-51');
     foreach($myposts as $post) :
       setup_postdata($post);
     ?>
    			<div class="PostContainer">
    				<div class="PostTitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></div>
                    <div class="PostDate">On <?php the_date(); ?></div>
                    <div class="PostContent">
                        <?php the_content(); ?>
                	</div>
    			</div>
     		<?php endforeach; ?>

    This does not allow for pagination, and therefore no infinite scrolling...

    How would you do it?

Topic Closed

This topic has been closed to new replies.

About this Topic