Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Returns some GBS deals
global $wp_query;
$add_deal_query= null;
'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>
/* After loop */
$add_deal_query = null; $add_deal_query = $temp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.