fork download
  1. <?php
  2. global $wp_query;
  3.  
  4. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  5. $args=array(
  6. 'post_type'=>'excursions',
  7. 'posts_per_page' => 9,
  8. 'paged'=>$paged
  9. );
  10.  
  11. $temp = $wp_query;
  12. $wp_query= null;
  13. $wp_query = new WP_Query($args);
  14.  
  15. ?>
  16.  
  17. <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
  18.  
  19. <div class="post">
  20.  
  21. <a href="<?php the_permalink() ?>">
  22. <?php echo get_the_post_thumbnail($post->ID, array(278, 208)) ?>
  23.  
  24. <h2 class="title"><?php the_title(); ?> </h2>
  25.  
  26. <p class="price"> <?= get_post_meta($post->ID, 'price_val', true) ?> </p>
  27. </a>
  28.  
  29. <p class="excerpt"><?php the_excerpt(); ?></p>
  30.  
  31. </div>
  32.  
  33.  
  34. <?php
  35. endwhile;
  36.  
  37. the_posts_pagination();
  38. $wp_query = null;
  39. $wp_query = $temp;
  40. wp_reset_query();
  41. ?>
Runtime error #stdin #stdout #stderr 0.01s 82880KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Error: Call to undefined function get_query_var() in /home/S82Zxv/prog.php:4
Stack trace:
#0 {main}
  thrown in /home/S82Zxv/prog.php on line 4