Created
September 20, 2013 05:48
-
-
Save rabbitinblack/6633748 to your computer and use it in GitHub Desktop.
WordPress : WP_Query
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 | |
$args = array( | |
'cat' => 1, | |
'posts_per_page' => 4 | |
); | |
$custom_query = new WP_Query($args); | |
while($custom_query->have_posts()) : $custom_query->the_post(); ?> | |
<?php endwhile; ?> | |
<?php wp_reset_postdata(); // reset the query ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment