Guest User

Untitled

a guest
Feb 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. if ( have_posts() ) :
  2. while ( have_posts() ) : the_post();
  3. // This inner part of the Loop varies by theme
  4. the_content();
  5. endwhile;
  6. endif;
  7.  
  8. <div class="row container">
  9. <div class="left column">
  10. <?php
  11. // Your standard Loop goes here
  12. if ( have_posts() ) :
  13. while ( have_posts() ) : the_post();
  14. // Format as desired
  15. the_content();
  16. endwhile;
  17. endif;
  18. ?>
  19. </div>
  20. <div class="right column">
  21. <?php
  22. // This is where you create an additional Loop
  23. $args = array(
  24. 'post_type' => 'post',
  25. 'category_name' => 'your-category', // change to your category
  26. 'posts_per_page' => 5 // change to the total you want to display
  27. );
  28. // run the query
  29. $thirdLoop = new WP_Query($args);
  30. // Now this looks mostly like a normal Loop:
  31. if($thirdLoop->have_posts()):
  32. while ( have_posts() ) : the_post();
  33. // Format as desired
  34. the_content();
  35. endwhile;
  36. endif;
  37. </div>
  38. </div>
Add Comment
Please, Sign In to add comment