Created
May 18, 2014 21:57
-
-
Save flegfleg/f687a920ff134dff77b8 to your computer and use it in GitHub Desktop.
wp secondary loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// get news | |
$args = array ('post_type'=> 'post', 'posts_per_page' => 5 ); | |
$the_query = new WP_Query( $args ); | |
if ( $the_query->have_posts() ) : | |
while ( $the_query->have_posts() ) : $the_query->the_post(); | |
get_template_part('news', 'compact'); | |
endwhile; endif; | |
wp_reset_postdata(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment