Last active
December 17, 2015 15:19
-
-
Save jartes/5630757 to your computer and use it in GitHub Desktop.
Get 20 posts from one category by slug
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
$args = array( | |
'category_name' => 'slug', | |
'posts_per_page'=> 20 | |
); | |
$mis_posts = new WP_Query( $args ); | |
while ( $mis_posts->have_posts() ) { | |
$mis_posts->the_post(); | |
/** | |
* the_title(); | |
* the_content(); | |
*/ | |
} | |
wp_reset_postdata(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment