Created
March 18, 2011 18:15
-
-
Save sproutventure/876556 to your computer and use it in GitHub Desktop.
Returns some GBS deals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wp_query; | |
$add_deal_query= null; | |
$args=array( | |
'post_type' => 'deal', | |
'post_status' => 'publish', | |
'meta_key' => $gb->_metaDealExpiration, // Make sure the deal is not exprired | |
'posts_per_page' => 3, // return this many | |
'post__not_in' => array( $wp_query->post->ID ) // do not show the current deal within this loop | |
); | |
$add_deal_query = new WP_Query($args); | |
if ($add_deal_query->have_posts()) { | |
/* Before loop */ | |
while ($add_deal_query->have_posts()) : $add_deal_query->the_post(); | |
?> | |
<li><?php the_title() ?>Other stuff...</li> | |
<?php | |
endwhile; | |
/* After loop */ | |
} | |
$add_deal_query = null; $add_deal_query = $temp; | |
wp_reset_query(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment