Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<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