Show a fresh image on every page load.
[mpress_image_refresh] shortcode supports a few attributes to give you more control over the results:
attachment - You can pass in a comma separated list of image IDs if you want to directly specify a set of images to use. Using this attribute invalidates the
not attributes. Example:
[mpress_image_refresh attachment="19, 37, 940"]
post_id - You can pass in the post ID to pull attached images from. If your images are attached to another post, just provide the ID of that post and we will pull those images instead. Example:
size - By default, we use the 'large' image size defined by WordPress. However, you can use the other built-in image sizes ( 'thumbnail', 'medium', 'full' ) or any custom image sizes you have defined. Example:
class - Set a custom class on your image using this attribute so you can apply custom styling. Example:
not - Sometimes you have an image within the page content, and as such it is automatically attached to the page or post. You probably don't want these images to be used as one of your random images, so just pass in the ID of those images to keep those from showing up. Example:
[mpress_image_refresh not="2310, 2319"]
caption - You can pass in 'true' or 'false'. If set to 'true', then the caption will be displayed below the image. Example:
[mpress_image_refresh attachment="5,7,9" caption="true"].
Keep in mind that any of these attributes can be combined as needed. Example:
[mpress_image_refresh post_id="19" size="full" not="2310"]. Also, keep in mind that the shortcode can be used in text widgets. However, you will probably want to define the post_id attribute when using the shortcode in a text widget.
mpress_image_refresh-image_html-- Provides ability to filter the final image HTML. The attachment post object and shortcode attributes are provided as additional parameters to the callback function.
Requires: 3.2 or higher
Compatible up to: 4.1.4
Last Updated: 2015-2-3
Active Installs: 400+
1 of 5 support threads in the last two months have been resolved.
Got something to say? Need help?