Last active
January 12, 2018 03:57
-
-
Save tisuchi/ff764c72ff421741a6ed7d91245b1fda to your computer and use it in GitHub Desktop.
Wordpress show all posts of a category
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( '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