Skip to content

Instantly share code, notes, and snippets.

@samuelhorn
Created December 3, 2013 08:59
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 samuelhorn/7766127 to your computer and use it in GitHub Desktop.
Save samuelhorn/7766127 to your computer and use it in GitHub Desktop.
Custom post type query
<?php
// Makes an array with own query wich not affects the ain loop
$events = new WP_Query(array("post_type" => "event"));
if ($events->have_posts()): while($events->have_posts()): $events->the_post();
get_template_part("loop");
the_content();
endwhile; endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment