Skip to content

Instantly share code, notes, and snippets.

@hchouhan
Created September 27, 2013 11:43
Show Gist options
  • Save hchouhan/6727363 to your computer and use it in GitHub Desktop.
Save hchouhan/6727363 to your computer and use it in GitHub Desktop.
IRT - Updated code
<?php
$query_top_10_showcase = new WP_Query(
array(
'post_type' => array( 'showcase' ),
'orderby' => 'meta_value',
'meta_key' => '_recommended',
'paged' => $paged
)
);
// Run the loop as normal
if ( $query_top_10_showcase->have_posts() ) :
while ( $query_top_10_showcase->have_posts() ) : $query_top_10_showcase->the_post();
$url = get_post_meta( $post->ID, '_dot_showcase_url', true );
$recommended = get_post_meta( $post->ID, '_recommended', true );
?>
<p>
<?php the_title() ?> - <?php echo $recommended; ?>
</p>
<?php
endwhile;
else:
// no posts found
endif;
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment