Last active
March 29, 2017 15:12
-
-
Save dboutote/215eb9d24b47ebf272d248cedc1b9a9d to your computer and use it in GitHub Desktop.
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
<ul> | |
<?php | |
global $post; | |
$args = array( 'numberposts' => 5, 'post_type' => 'article' ); | |
$myposts = get_posts( $args ); | |
foreach( $myposts as $post ) : | |
setup_postdata($post); ?> | |
<li> | |
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br /> | |
<?php the_excerpt();?> | |
</li> | |
<?php | |
endforeach; | |
wp_reset_postdata(); ?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment