Skip to content

Instantly share code, notes, and snippets.

Last active Mar 29, 2017
What would you like to do?
global $post;
$args = array( 'numberposts' => 5, 'post_type' => 'article' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) :
setup_postdata($post); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
<?php the_excerpt();?>
wp_reset_postdata(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment