Skip to content

Instantly share code, notes, and snippets.

@laurenclark
Created August 20, 2014 15:36
Show Gist options
  • Save laurenclark/9d4232cd5f36ad7c0bf1 to your computer and use it in GitHub Desktop.
Save laurenclark/9d4232cd5f36ad7c0bf1 to your computer and use it in GitHub Desktop.
Custom Fields WP_Query Loops
$args = array(
'post_type' => 'post_type',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 3
);
$reference = new WP_Query( $args );
?>
<?php /* Start loop */ ?>
<?php if ( have_posts() ) : while ( $reference->have_posts() ) : $reference->the_post(); ?>
<?php endwhile; endif; ?>
<?php /* End Loop */ ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment