Guest User

Untitled

a guest
Feb 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. // WP_Query arguments
  2. $args = array(
  3. 'post_type' => 'trabajo',
  4. 'posts_per_page' => '2',
  5. 'paged' => ( get_query_var('paged') ) ? get_query_var('paged') : 1,
  6. );
  7.  
  8. // The Query
  9. $trabajo_query = new WP_Query( $args );
  10. $temp_query = $wp_query;
  11. $wp_query = NULL;
  12. $wp_query = $trabajo_query;
  13.  
  14.  
  15. // The Loop
  16. if ( have_posts() ) {
  17. while ( have_posts() ) {
  18. the_post();
  19. the_title();
  20. }
  21. }
  22. wp_reset_postdata();
  23. the_posts_navigation();
  24.  
  25. $wp_query = NULL;
  26. $wp_query = $temp_query; // Reset
Add Comment
Please, Sign In to add comment