Responsive slider plugin to create sliders in visual editor easily. Build beautiful image slider, layer slider...
Gallery Image Captions (GIC) allows you to customise WordPress gallery image captions.
Gallery Image Captions (GIC) is a WordPress plugin that allows you to display additional image attributes such as title, caption, and description in your galleries. It modifies the default WordPress gallery shortcode to enable custom filtering of image captions, making it suitable for users who want more control over how their image captions appear.
After installing and activating the plugin, you can write a filter to customize the gallery image captions. This is particularly useful for photography enthusiasts or anyone looking to enhance their image galleries with more detailed information.
Best for: This plugin is best for photographers and WordPress users who want to enhance their gallery captions.
What it does well
Where it falls short
Gallery Image Captions (GIC) offers useful features for customising image captions, but it may require technical knowledge to implement effectively.
mark l chaves's own description of Gallery Image Captions, lightly tidied.
With GIC, you can display the title, caption, and description image attributes. You can also change/filter the rendering HTML to whatever you want.
After installing and activating GIC, write your filter and add the WordPress Gallery shortcode to your page.
If you’ve been dreaming of writing a filter to customise the gallery image captions, then this plugin is for you.
The default WordPress gallery shortcode will only display the caption from the media’s attachment metadata. Sometimes it’s nice to display more like the title—even the description.
The GIC plugin overrides the WordPress gallery shortcode function to create a hook. With this hook you can do a little bit more than just displaying the caption.
Some premium themes hide the caption completely. This leaves photography lovers like me scratching their head and spending precious time cobbling together makeshift caption blocks.
The crux of this plugin is the ability to filter the gallery image caption. The galimgcaps_gallery_image_caption hook makes this possible.
For the usage examples below, this is the filter used.
/**
* Custom Filter for Gallery Image Captions
*
* Note: Avoid altering captiontag, selector, and itemtag.
*/
function mlc_gallery_image_caption($attachment_id, $captiontag, $selector, $itemtag) {
$id = $attachment_id;
// Grab the meta from the GIC plugin.
$my_image_meta = galimgcaps_get_image_meta($id);
/**
* Here's where to customise the caption content.
*
* This example uses the meta title, caption, and description.
*
* You can display any value from the $my_image_meta array.
* You can add your own HTML too.
*/
return "<{$captiontag} class='wp-caption-text gallery-caption' id='{$selector}-{$id}'>" .
"Title: " . $my_image_meta['title'] . "<br>" .
"Caption: " . $my_image_meta['caption'] . "<br>".
"Description: ". $my_image_meta['description'] .
"</{$captiontag}></{$itemtag}>";
}
add_filter('galimgcaps_gallery_image_caption', 'mlc_gallery_image_caption', 10, 4);
Feel free to use this filter code as a starter template. After activating the GIC plugin, add the code above to your child theme’s functions.php file. Rename the function and tweak the return string to suit your needs.
/**
* New GIC 1.4.0 filter for custom meta fields.
*/
function gic_add_custom_fields( $image_meta, $attachment ) {
// This is how you add a custom fields to the array that
// GIC uses to display captions.
$image_meta['credit_text'] = $attachment->credit_text;
$image_meta['credit_link'] = $attachment->credit_link;
return $image_meta;
}
add_filter( 'galimgcaps_image_meta', 'gic_add_custom_fields', 10, 2 );
To use these two custom fields, your galimgcaps_gallery_image_caption would look something like this.
Other plugins for photo galleries.
Responsive slider plugin to create sliders in visual editor easily. Build beautiful image slider, layer slider...
Slider, gallery, carousel plugin for WordPress. Build your image slider, video slider, post slider, YouTube sl...
FooGallery is a fast, responsive photo gallery and image gallery plugin with 7 gallery layouts, built-in light...
Formerly Easy Fancybox. The most popular WordPress lightbox plugin. Simple, fast, and responsive. Opens images...
The most popular lightbox plugin and responsive gallery builder for WordPress.
The Feeds for YouTube plugin allows you to display customizable YouTube feeds from any YouTube channel.