Show Posts by Tag

I’ve always used get_posts to fetch posts by category, but recently I needed to show posts with a particular tagĀ and get_posts doesn’t seem to support this. Fortunately query_posts allows selection by tag as well as by category. Here’s the code I used: