Get Post Image is a WordPress plugin I wrote a while back to create the “distractions” section on my front page. Once installed the plugin offers a simple way to retrieve images contained in posts, allowing them to be displayed elsewhere in your theme.
In the case of my “distractions” section I retrieve the six most most recent posts from the distraction category, then use Get Post Image to retreive the first image that they each contain. These images are then displayed on my front page as a 3×2 row of thumbnail links to the actual posts themselves.
It’s a useful little plugin so I’ve cleaned it up, added some documentation and examples, and put it up for download.
You can find the examples and the download at its new home here






2007/06/21, 06:38
I’ve been reading for a while but this post made me want to say 2 thumbs up. Keep up the great work. Bill
2007/07/22, 02:39
hi,thanks for this useful plugin. can you include an option on how to use the thumbnail picture instead? thanks.
2007/10/22, 14:00
Andrew,
Thank you for this plugin. Because I am not versed in code, I have no idea how or where to insert the code you give as examples on your site. I want to show 6 pics at once in my sidebar. I’ve placed your code into sidebar.php as shown below:
query_posts(’category_name=resources&showposts=6′);
while(have_posts())
{
the_post();
$image_tag = gpi_get_image(0,”http://www.myserver.com/default.jpg”);
$url = get_permalink();
echo “$image_tag“;
}
?>
For some reason this completely closes down my sidebar – ie, the sidebar completely disappears. What am I doing wrong? Please help! Thanks so much.
Dwayne