Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( have_posts() ) :
- while ( have_posts() ) : the_post();
- // This inner part of the Loop varies by theme
- the_content();
- endwhile;
- endif;
- <div class="row container">
- <div class="left column">
- <?php
- // Your standard Loop goes here
- if ( have_posts() ) :
- while ( have_posts() ) : the_post();
- // Format as desired
- the_content();
- endwhile;
- endif;
- ?>
- </div>
- <div class="right column">
- <?php
- // This is where you create an additional Loop
- $args = array(
- 'post_type' => 'post',
- 'category_name' => 'your-category', // change to your category
- 'posts_per_page' => 5 // change to the total you want to display
- );
- // run the query
- $thirdLoop = new WP_Query($args);
- // Now this looks mostly like a normal Loop:
- if($thirdLoop->have_posts()):
- while ( have_posts() ) : the_post();
- // Format as desired
- the_content();
- endwhile;
- endif;
- </div>
- </div>
Add Comment
Please, Sign In to add comment