What is Exifography?
Exifography displays EXIF data for images uploaded with WordPress. It utilises WordPress’ own feature of storing EXIF fields in the database, and also enables import of latitude and longitude, exposure bias and flash fired EXIF to the database upon image upload.
Exifography was previously named Thesography, and only had auto-insert into posts in the Thesis theme from DIYthemes. The plugin now works the same way across all themes, so I wanted to change the name to increase visibility and understanding of what the plugin does.
I’ve been using EXIF display on my photoblog for some time. I’ve also written a couple of posts about EXIF with WordPress; Geo EXIF data in WordPress and Add image EXIF metadata to WordPress. Some people expressed a desire to see this functionality in a plugin without modifying WordPress files: this is it.
The purpose of this plugin is to make dislaying EXIF data as convenient as possible, while using as much of WordPress’ native image handling as possible — for convenience, forward compatability and because WP image handling has come a long way since its advent.
Download current version
Installing the plugin
You can use the built in WordPress installer, by searching for “Exifography” in the Plugins > Add New panel, or follow these steps:
- Upload the Exifography folder to your wp-content/plugins directory.
- Visit the plugins page of your WordPress dashboard and activate the plugin.
- Visit the Exifography Options page under Settings in your WordPress dashboard.
EXIF field options
There are 3 ways to specify which fields are displayed:
- on the main options page — these are the default options and can be overridden by either of the other two options
- individual post options — if you have the default options set, the post options will automatically inherit those, but if you change the options on an individual post it will use these instead, and if you deselect all the options on a post exif won’t display for that post
- shortcode options — if you insert a shortcode into a post it will use first the options that you give it, if you don’t give it any it will use the post options, and if there are none of those it will display all the fields available for that image
Display EXIF automatically
Automatic EXIF display inserts the data for the first image attached to the post at the end of the post.
Display EXIF via shortcodes
EXIF data can be displayed anywhere in your posts via shortcodes. Unlike automatic display, you can display EXIF for multiple images when using shortcodes by specifying the ID of the image.
Use the syntax [exif]
.
By default the shortcode will display the EXIF items set in the post options, if there are none of those it will show all available exif items for the first image attached to the post.
Display certain EXIF fields
To select the fields you want to display use the attribute “show”.
[exif show="aperture,location,shutter"]
The following list contains valid arguments for the attribute “show”.
- all
- aperture
- credit
- camera
- caption
- created_timestamp
- copyright
- exposure_bias
- flash
- focal_length
- iso
- location
- shutter_speed
- title
Display EXIF for specific (and multiple) images
To show the EXIF for a specific image and potentially multiple images within a post, use the attribute “id”. To show multiple images, use the whole shortcode multiple times with different IDs.
[exif id="457"]
You can find the shortcode with ID for an image by viewing the image details in the media dialogue. Press this button to bring up the dialogue: .
Then copy the shortcode from the image details and paste it into the post.
Add EXIF display to your theme
You may also add EXIF data to your theme manually using the function exifography_display_exif($options,$imgID);
. This can be used within the loop, with or without an image ID, or outside of the loop if an image ID is provided. To make sure that your theme doesn’t break if the plugin is disabled, use this check to check if the function is there before using it.
The function accepts two parameters: the options for the EXIF items to display and the image ID. If no image ID is provided it will default to the first image attached to the post. The options parameters are the same as those for the shortcode parameters.
In Thesography the display function was just called display_exif();
I found this to be too generic, so I’m deprecating it. The old function will still work for a time, but please switch to the new one soon.
Display only some fields of the first attached image
echo exifography_display_exif('aperture,shutter,iso');
Display all fields of a certain image
echo exifography_display_exif('all',457);
or
echo exifography_display_exif('',457);
Display certain fields of a specific image
echo exifography_display_exif('aperture,shutter,iso',457);
More Tutorials
- Using a Google Maps API Key
- IDs and classes in Exifography output
- Filtering Exifography output
- Add EXIF to WordPress gallery images
- Using photo location data
Support
If you need support for this plugin please post it to the WordPress Forums. I will monitor the forum, but if you don’t get a reply please email me the link to your forum thread.
Localisation
Exifography supports language localisation. If you would like to contribute a translation to be included with the plugin please contact me. You can also keep your own translation in your wp-content directory by putting your .mo file in wp-content/languages; it should automatically load from there if the file is called exifography-lang.mo, where “lang” is the appropriate language code for WordPress (you can find yours in the WordPress Codex).
Exifography comes with its own .po file in the plugin’s languages folder, which contains all the translatable strings. You can use this with software, e.g., Poedit, to make your own translation.
Big thanks to Alejandro Herrero for working out the bugs with language file referencing in v1.0.2.
License
Exifography is licensed under the GNU General Public License.
Upgrading from Thesography
Notes on upgrading from Thesography:
- I have changed some of the exif field parameters back to the way they are saved in the database for efficiency and tidiness in the code. The old parameters will still work, but that’s why they are a bit different in the documentation now.