Get Image from Post, a Free WordPress Plugin

As with many of my free WordPress plugins here on the website this one is used extensively throughout my website to help me deliver a great site for my visitors. The plug basically allows users to grab an image from their posts and display it in the Loop.

It’s perfect for home pages, archives etc. where you link to include a visual idea of what the posts about.

This is a simple plugin which allows users to return an image from the related post.

Please feel free to download this plugin.

Installation

To install the plugin, please upload the folder to your plugins folder and active the plugin.

== Frequently Asked Questions ==

= How do I display the results? =

Insert the following code into your WordPress theme files: 

= General results =

ithout passing any parameters, the plugin will return ten results or fewer depending on how many posts you have.

 get_image_from_post();

= Altering the before and after values =

By default the plugin wraps your code in list item (<li>) tags but you can specify how to format the results using the following code:

 get_image_from_post(‘before=<p>&after=</p>’);

= Adding a Link = 

If you’d like to link to the post (remember it’s not live yet) you can do so by calling:

 get_image_from_post(‘link=true’);

= Echo vs. Return =

Finally, if you’d like to copy the results into a variable you can return the results as follows:

 get_image_from_post(’show=false’);

12 Responses to “Get Image from Post, a Free WordPress Plugin”

  1. Li-An says:

    Hello,
    does your plugin only shows original image or creates a thumbnail ?

    Li-An’s last blog post..Un projet de remake 3D des Maîtres du Temps de Laloux & Moebius

  2. Hi Li-An, it pulls the first image and displays it as a graphic. If you’d like to resize it, you can use CSS to alter the size.

  3. baron says:

    Works great, thank you

  4. Li-An says:

    OK. Thank you for your answer.

  5. Li-An says:

    I have to say to you that I got this error when I post a comment on your blog.

    “Warning: Cannot modify header information – headers already sent by (output started at /home1/getawayg/public_html/thisismyurl/wp-content/plugins/popularity-stats/popularity-stats.php:300) in /home1/getawayg/public_html/thisismyurl/wp-comments-post.php on line 81″

  6. joram says:

    hi,
    I’ve tried doing everything from the above but nothing is showing.
    Okay,I’m trying to insert the code in the side bar:
    The code is at the bottom:
    ……………………………………………………………………..

    Search

    Categories

    Archives

    get_image_from_post();

    ………………………………………………………………

    Best regards

  7. joram says:

    Sorry, this is how the code looks like:
    http://freeuganda.org/?page_id=87

  8. @joram – in order for the plugin to work, it needs to know what image you’re attempting to get the image from. To do that, currently the plugin needs to be used in the Loop, so instead of using it in the sidebar (as you’re currently doing), try placing it just before the_content() in your index.php file and it’ll search for the image for you.

  9. joram says:

    hi Christopher,
    I’ve done the above but nothing.
    In my index.php file, there’s no the_content() but as you can see: http://freeuganda.org/?page_id=87

    Best regards

  10. Padam says:

    get_image_from_post() is a great plugin. I have one question. How can I make the image linked. It is said to use get_image_from_post(‘link=true’) but my images are not linked. Can anyone help me out. Or sud I do some changes in plugin?

  11. Online Dizi says:

    Thanx…nice plugin

  12. Nico says:

    Really nice plugIn but it seems that I have to upload the pictures to my media library to make it work. Thats a problem since I link my pictures from kttns.org to avoid traffic. Is there a workaroud?

Leave a Reply