Skip to content

Instantly share code, notes, and snippets.

@Ahrengot
Created February 8, 2012 13:48
Show Gist options
  • Save Ahrengot/1769687 to your computer and use it in GitHub Desktop.
Save Ahrengot/1769687 to your computer and use it in GitHub Desktop.
Alter primary loop
// Used to alter main loop. For secondary loops use get_posts() or make a new instance of WP_Query()
<?php
query_posts( array ( 'post_type' => 'artists', 'posts_per_page' => -1, 'order' => 'ASC' ) );
if(have_posts()) : while (have_posts()) : the_post();
?>
<!-- stuff like the_title(); -->
<?php
endwhile;
endif;
wp_reset_query();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment