Skip to content

Instantly share code, notes, and snippets.

@jartes
Last active December 17, 2015 15:19
Show Gist options
  • Save jartes/5630757 to your computer and use it in GitHub Desktop.
Save jartes/5630757 to your computer and use it in GitHub Desktop.
Get 20 posts from one category by slug
$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