Advertisement
imranmodel32

query custom post type

Aug 26th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1.  
  2. <?php
  3. $temp = $wp_query;
  4. $wp_query = null;
  5. $wp_query = new WP_Query();
  6. $wp_query->query('showposts=12&post_type=solution'.'&paged='.$paged);
  7.  
  8. while ($wp_query->have_posts()) : $wp_query->the_post();
  9. ?>
  10.  
  11. <!-- LOOP: Usual Post Template Stuff Here-->
  12. <div class='single_post_area'>
  13. <div class='single_post'>
  14.  
  15. <a href="#"><?php the_post_thumbnail();?></a>
  16. <h5><a href=""><?php the_title();?></a></h5>
  17. <p><?php the_content();?></p>
  18.  
  19. </div>
  20. </div>
  21. <!-- LOOP: Usual Post Template Stuff Here-->
  22.  
  23. <?php endwhile; ?>
  24.  
  25. <nav class="pagination_nav">
  26. <div class="first_nav"><?php previous_posts_link('&laquo; Newer') ?></div>
  27. <div class="second_nav"><?php next_posts_link('Older &raquo;') ?></div>
  28. </nav>
  29.  
  30. <?php
  31. $wp_query = null;
  32. $wp_query = $temp; // Reset
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement