Show captions under thumbnails

Sunshine has an option to show the image name under the thumbnails in the Gallery view. In Sunshine > Settings > Galleries > Show Image Name option. First step is to enable this option.

Now we need to add some custom code either to our theme’s functions.php file or use a plugin like Code Snippets to do so without having to edit your theme. This code uses the “sunshine_image_name” filter and if a caption exists it replaces the image name to be displayed.