Wordpress Get Post Image
Get Post Image is a plugin for Wordpress 2.0 and higher that allows you to retrieve images contained in posts and display them in a custom manner.
An example of where this can be useful is the “Distractions” section of andrew grant homepage. For this section images are retrieved from the first six posts in the distraction category, and then displayed as a list of hyperlinks to the actual article
Here are examples of how to use Get Post Image in your theme. (Note: Get Post Image must be used within the post loop after you have retrieved the desired posts)
You will need to add this CSS style to your style.css
——————————————————–
.post-image { width: 105px; height:146px; border: 2px solid #e2e2e2; padding: 3px; margin: 0 5px 5px 0; }
—————————————————-
Place this code in your index.php
——————————————————
<?php
query_posts(’showposts=16&offset=0′);
while(have_posts())
{
the_post();
$image_tag = gpi_get_image(0,”http://www.myserver.com/default.jpg”, “post-image”);
$url = get_permalink();
echo “<a href=’$url’>$image_tag</a>”;
}
?>
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.









I couldn’t understand some parts of this article ss Get Post Image | Celebrity style, but I guess I just need to check some more resources regarding this, because it sounds interesting.