I am trying to figure out how to display lets say the latest post tagged "example-tag". And possibly a way so can call the second and third latest post tagged "example-tag"?

1 answer


You'll need to use WP_Query(), or at least that's how I grabbed recent posts from a specific category to show on our website's main page.

$a = new WP_Query('tag=example-tag&posts_per_page=3');
while($a->have_posts())  { $a->the_post(); .... }

Within the while loop, you can use statements like the_permalink(), the_excerpt(), and etc.

See the following pages:


The latter will tell you what parameters can go into WP_Query() to customize your results.

Answered almost 9 years ago by Kevin Seitz