How do I repeat a wordpress loop which contains altered design using another loop -
i have achieved layout below using 2 loops, repeat layout way down page. how do this, have offset option using 2 loops already. layout repeat down page
this code have used achieve this:
<div class="row hidden-xs hidden-sm"> <?php $posts = get_posts('category_name=news&numberposts=3&offset=1'); foreach ($posts $post) : start_wp(); ?> <div class="col-md-4"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('full', array('class' => 'img-responsive')); ?> </a> <!-- headline , excerpt --> <div class="news-story-box"> <h4 class="top-story-title"> <a href="<?php the_permalink(); ?>" class="top-story-title"><?php the_title(); ?></a> </h4> <font size="2"><i><?php echo human_time_diff( get_the_time('u'), current_time('timestamp') ) . ' ago'; ?></i></font> </div><!-- news-story-box --> </div><!-- col-md-4 --> <?php endforeach; ?> </div><!-- row --> <p></p> <div class="row"> <?php $posts = get_posts('category_name=news&numberposts=2&offset=4'); foreach ($posts $post) : start_wp(); ?> <div class="col-md-6"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('full', array('class' => 'img-responsive')); ?> </a> <!-- headline , excerpt --> <div class="news-story-box"> <h4 class="top-story-title"> <a href="<?php the_permalink(); ?>" class="top-story-title"><?php the_title(); ?></a> </h4> <font size="2"><i><?php echo human_time_diff( get_the_time('u'), current_time('timestamp') ) . ' ago'; ?></i></font> </div><!-- news-story-box --> </div><!-- col-md-6 --> <?php endforeach; ?> </div><!-- row -->
Comments
Post a Comment