Plugin Directory

Simple Image Grabber

Grabs an image from a post and displays it.

1) How can I customize the Simple Image Grabber function?

The function from this plugin accepts five variables.

The basic use of the function looks like: <?php images('1'); ?> or <?php images(); ?>

This will display the first image from your post, with its default width and height, no class name and a link to the post.

This is how the function looks with all variables:

<?php images($number, $width, $height, $class, $link); ?>

$number = the image you want to pull from your post, ie. the first image from the post ('1') or the second image from the post ('2') and so on. NOTE: If you use 'all', it will display all images from the post.

$width = the width of the displayed image

$height = the height of the displayed image

$class = the class name you would like to assign to the displayed image

$link = whether you would like the displayed image to link to the post or not

So, the following function:

<?php images('2', '150', '200', 'alignleft', false); ?>

would display the second image from a post (if there is one) with a width of 150px and a height of 200px, the class name alignleft and no link to the post.

The following:

<?php images('all', '', '', 'alignright'); ?>

would display all images from a post with their original width and height, a class name of alignright and a link to the post.

Requires: 2.7 or higher
Compatible up to: 2.8.4
Last Updated: 2009-10-15
Downloads: 7,519

Average Rating

4 stars
(10 ratings)

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

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

100,2,2
100,1,1
100,2,2
100,1,1
100,1,1