Create a gist now

Instantly share code, notes, and snippets.

Embed
Wordpress show all posts of a category
<?php
$args = array( 'category' => 1, 'post_type' => 'post' );
$postslist = get_posts( $args );
foreach ($postslist as $post) : setup_postdata($post);
?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment