WordPress loop is missing posts on homepage after offset = 4
-
Hi,
I have a custom design and use an offset on the homepage of 4 in the second part of the code. As you can see on the website yourlittleblackbook.me after loading new posts it jumps from the 10th of April to the 3th of April and skips about 6 blog posts that are in the backend. Can anybody point me out in the right direction? Thanks in advance.
<!-- FIRST PART --> <?php if ( (is_home())&&!(is_paged()) ): ?> <div class="column-wrap"> <?php $posts = get_posts('numberposts=4&offset=0'); foreach ($posts as $post) : start_wp(); ?> <?php static $count1 = 0; if ($count1 == "4") { break; } else { ?> <div class="post-column <?php echo get_the_ID();?>"> <div class="title"> <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> </div> <span class="entry-date"><?php echo get_the_date(); ?></span> <div class="image"> <a href="<?php the_permalink(); ?>"><img src="<?php echo catch_that_image() ?>"/></a> </div> <a class="more-link" href="<?php the_permalink(); ?>">[ Read more ]</a> <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </script> <span class="social-share-bttns"><a class="comments-link" href="<?php echo get_permalink(); ?>/#comments-post"> LEAVE A REPLY </a> <button class="social-share" onclick="toggle_visibility('<?php echo get_the_ID();?>');">SHARE THIS</button></span> <div id="<?php echo get_the_ID();?>" class="social-share-box" style="display:none;"> <ul> <li class="twitter"><a target="_blank" href="http://www.twitter.com/share?url=<?php echo get_permalink();?>"/>Tweet</a></li> <li class="facebook"><a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=<?php echo get_permalink();?>">Share</a></li> <li class="mail"><a href="mailto:emailname@yourdomain.com?subject=Leuke post op YourLittleblackbook.me - <?php echo the_title();?>&body=He, ik kwam deze leuke post tegen op Yourlittleblackbook: <?php echo get_permalink();?>">Mail</a></li> <li class="googleplus"><a target="_blank" href="https://plus.google.com/share?url=<?php echo get_permalink();?>">Google +</a></li> </ul> </div> </div> <?php $count1++; } ?> <?php endforeach; ?> </div> <!-- SECOND PART --> <?php $posts = get_posts('offset=4'); foreach ($posts as $post) : start_wp(); ?> <?php twentyeleven_content_nav( 'nav-above' ); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?> <?php endforeach; ?> <div class="splitter-index" style="clear: both;"></div> <?php endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘WordPress loop is missing posts on homepage after offset = 4’ is closed to new replies.