Multiple posts load as one post, in wrong order
-
Trying to use ALM to load excerpts of up to 11 posts on my home page. Should be 7 that appear on page load, then 4 more load when you scroll to the bottom. Right now ALM seems to be loading all 11 as one post, so using offset=”7″ in this case does nothing. On top of that, the posts that do load are not even the most recent, but older.
Here is the relevant code from the home page, with shortcode:
<div id="scroll-container"> <?php echo do_shortcode('[ajax_load_more post_type="post" posts_per_page="11" category__not_in="11,16,17,18,20,21,22" offset="7" scroll_container="#scroll-container" transition="fade" destroy_after="11" orderby="date" order="DESC"]'); ?> </div>And here is my Repeater Template (each post within its own Bootstrap panel):
<div class="panel panel-info home-load-panel"> <div class="panel-heading"> <div class="panel-title"> <div class="label label-primary"><?php foreach((get_the_category()) as $category) { echo strtoupper($category->cat_name); } ?></div> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <small><?php foreach( (get_the_category() ) as $category) { if ($category->term_id == 6) { echo 'by ' . get_the_author(); } } ?></small> </div> </div> <div class="panel-body alignleft"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'small', array( 'align' => 'left', 'style' => 'padding-right:7px', 'class' => 'img-responsive' ) ); } the_excerpt(); ?> <p class="pull-right"> <?php foreach((get_the_category()) as $category) { if ($category->term_id == 1) { $get_btn_language = 'the full story'; } elseif ($category->term_id == 6) { $get_btn_language = 'the blog post'; } else { $get_btn_language = 'more'; } } ?> <a href="<?php the_permalink(); ?>" class="btn btn-primary">Read <?php echo $get_btn_language; ?> <i class="fa fa-long-arrow-right"></i></a> </p> </div> </div>Is there a way to get ALM to recognize each panel/post as a single post and not just one post consisting of 11 items?
The topic ‘Multiple posts load as one post, in wrong order’ is closed to new replies.