Skip to content

Instantly share code, notes, and snippets.

@nickberens360
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickberens360/9670945 to your computer and use it in GitHub Desktop.
Save nickberens360/9670945 to your computer and use it in GitHub Desktop.
wordoress: custom post type by category wp_query
<?php
$args = array(
'post_type' => 'sponsor',
'sponsorship_level' => 'platinum_sponsors',
'orderby' => 'menu_order title',
'order' => 'ASC',
);
$query = new WP_Query( $args );
?>
<?php if($query->have_posts()) : ?>
<?php while($query->have_posts()) : $query->the_post() ?>
...
<?php endwhile ?>
<?php endif ?>
<?php wp_reset_postdata(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment