Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Returns some GBS deals
<?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