Advertisement
firoze

post and page without any custom type

Mar 11th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. // show post and page without any custom type (mainly show this for 404.php)
  2.  
  3. <div class="four-zero-page-area">
  4. <div class="row">
  5. <div class="col-md-6">
  6. <div class="recent-pages">
  7. <h2>Recent Pages</h2>
  8. <ul>
  9. <?php if(!is_paged()) { ?>
  10. <?php
  11. $args = array( 'post_type' => 'page', 'posts_per_page' => 10 );
  12. $loop = new WP_Query( $args );
  13. ?>
  14. <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  15. <li><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
  16. <?php endwhile; ?>
  17. <?php wp_reset_query(); ?>
  18. <?php } ?>
  19. </ul>
  20. </div>
  21. </div>
  22. <div class="col-md-6">
  23. <div class="recent-posts">
  24.  
  25. <h2>Recent Posts</h2>
  26. <ul>
  27. <?php if(!is_paged()) { ?>
  28. <?php
  29. $args = array( 'post_type' => 'post', 'posts_per_page' => 10 );
  30. $loop = new WP_Query( $args );
  31. ?>
  32. <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  33. <li><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
  34. <?php endwhile; ?>
  35. <?php wp_reset_query(); ?>
  36. <?php } ?>
  37. </ul>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement