Override Image Captions

You can override image captions in FooGallery by following these steps:

First, you will either need to edit your theme’s functions.php or install a plugin that allows you to include custom code snippets. We recommend this plugin: Code Snippets.

In this example, I want to override the caption title to be the image filename, and override the caption description to be the image uploaded date.

This is the code you will need to add:

add_filter( 'foogallery_get_caption_title_for_attachment', 'custom_foogallery_captions', 10, 2 );

function custom_foogallery_captions( $caption, $attachment_post ) {
 
  return basename( $attachment_post->guid );
  
}

add_filter( 'foogallery_get_caption_desc_for_attachment', 'custom_foogallery_caption_description', 10, 2 );

function custom_foogallery_caption_description( $caption, $attachment_post ) {
 
  return $attachment_post->post_date;
  
}

Resources

Find the right next step

Use this grid for documentation indexes, support routes, account links, affiliate resources, and download pages.

Documentation

Search setup guides, product docs, and troubleshooting articles.

Support

Open a ticket with product details so we can help quickly.

Licensing

Review account, renewal, refund, and license information.

Pricing update

Monthly & Lifetime plans are currently not unavailable

We’re not offering these payment options right now. Leave your name and email and we’ll let you know as soon as they return.

NameEmailNotify Me

No spam - Unsubscribe anytime