Advertisement
Guest User

Tribe Events wp_query

a guest
Nov 11th, 2014
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. <ul class="block posts-list upcoming-events">
  2. <?php /* Featured upcoming events */
  3.                
  4.                 $upcoming = new WP_Query();
  5.                 $upcoming->query( array(
  6.                     'post_type'=> array('tribe_events','post'),
  7.                     'meta_key' => 'home_featured',
  8.                   'meta_value'=> true,
  9.                   'posts_per_page' => 3)
  10.                 );
  11.    
  12.     if ($upcoming->have_posts()) :
  13.         while ($upcoming->have_posts()) :
  14.             $upcoming->the_post();
  15.             ?>
  16.             <li>
  17.               <?php if ( has_post_thumbnail() ) { ?>    
  18.                  <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail();?></a>
  19.               <?php }?>                
  20.               <div class="content">
  21.                   <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>                                
  22.               </div>        
  23.             </li>
  24.         <?php
  25.         endwhile;
  26.     endif;
  27.     wp_reset_query(); // reset the query ?>
  28. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement