WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Get Image from Post

Allows users to fetch an image from a post within the Loop.

How do I display the results?

Insert the following code into your WordPress theme files:

General results

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

thisismyurl_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:

thisismyurl_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:

thisismyurl_get_image_from_post('link=true');

Which image?

You can specify which image is returned using the code:

thisismyurl_get_image_from_post('image=2');

Strip Attributes

If you would like to strip the attributes such as width and height from the returned value:

thisismyurl_get_image_from_post('strip=true');

Echo vs. Return

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

thisismyurl_get_image_from_post('show=false');

Requires: 2.0.0 or higher
Compatible up to: 3.5.2
Last Updated: 2013-7-6
Downloads: 4,740

Ratings

4 stars
4.3 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
0,2,0
0,1,0
0,1,0