We'll create fresh WordPress site with Image Formatr installed. You have 20 minutes to test the plugin after that site we'll be deleted.
Image Formatr is a simple plugin that goes through all the content images on
posts & pages, and with zero user changes:
Thumbnails are not generated, but will be used if available in the media library.
This plugin is driven by the prettyPhoto
library so we could call this plugin a prettyPhoto integration plugin.
*Note: Supports images on Flickr.
This only applies to the images you put in your content, not theme graphics.
<img
src="/images/picture.jpg"
class="alignright"
title="A sample caption"
link="http://example.com/"
hint="Image borrowed from example.com"
/>
After the plugin runs, the output to the browser looks like:
<div class="img alignright">
<a
href="/images/picture.jpg"
rel="prettyPhoto[main]">
<img
src="/images/picture.jpg"
title="Image borrowed from example.com" alt=""
width="140" height="90"/>
</a>
<div style="width: 100%;">
<a href="http://example.com/" target="_blank">A sample caption</a>
</div>
</div>
You can find plugin documentation at http://warriorself.com/blog/about/image-formatr/
title
or alt
To get WordPress Gallery images to popup, this plugin must run at a priority
greater (later) than the [gallery] shortcode which runs at priority 11. Therefore
set the priority
setting to 12 in the Administration Options.
The actions of the plugin are enabled and disabled with administration settings
but can be overridden on each individual image.
usemysize
– true/false – true = do not ignore an image width and heightusemya
– true/false – true = do not ignore a parent anchor tagnocap
– true/false – true = do not create a captionnofx
– true/false – true = no popup effectlink
– string url – make the caption a link to the urlhint
– string txt – this will be the new image titleasis
– true/false – true = don’t change nuthingroup
– string txt – separate popup slideshowsthumb
– string url – image thumbnail (version 0.9.7)page
– single/!single/front/!front – page filtering (version 0.9.7)If you want to surround an image with an anchor tag <a>
, then you should add
a usemya
attribute within the image tag or else your anchor will be ignored
and replaced. If you do not want the popup effect at all, add a nofx
attribute
to the image. If you do not want any caption, you can specify nocap
, or just
leave the title blank. And to have the plugin completely ignore an image and
output the content directly from the post, use the asis
attribute.
Example
<a href="http://www.example.com/">
<img
src="/images/picture.jpg"
title="Click to visit website"
nocap="true"
usemya="true"
/></a>
Note: concerning the true/false overrides, do not include “false” parameters
like <img usemya="false">
, i.e these overrides should only include the attributes
for which you want to designate a “true” value.
Image Formatr is Copyright 2014 Steven Almeroth and
licensed under a GPL license.
Based on: image-caption
by Yaosan Yeo.
PrettyPhoto: The JavaScript
Image thumbnail viewer
library by Stephane Caron is licensed under GPLv2.
More information, including how to contact me, is available at
warriorself.com.