Last active
July 29, 2017 06:20
-
-
Save ericakfranz/06140de6a74bab49b7ca to your computer and use it in GitHub Desktop.
Display image title below thumbnails in Envira Gallery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Plugin Name: Envira Gallery - Image Titles below Thumbnails | |
* Plugin URI: http://enviragallery.com | |
* Version: 1.0 | |
* Author: Erica Franz | |
* Author URI: http://fatpony.me/ | |
* Description: Display titles below images | |
*/ | |
function envira_gallery_image_titles( $output, $id, $item, $data, $i ) { | |
// IDs of galleries to display titles on | |
$galleriesToShowTitles = array( | |
35, | |
36 | |
); | |
// Check if we need to display titles on this gallery | |
if ( !in_array( $data['id'], $galleriesToShowTitles ) ) { | |
return $output; | |
} | |
if ( isset( $item['title'] )) { | |
$output .= '<span class="title">' . $item['title'] . '</span>'; | |
} | |
return $output; | |
} | |
add_action( 'envira_gallery_output_after_link', 'envira_gallery_image_titles', 10, 5 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Add some styling to space the title, remember to replace the ID with your gallery's ID */ | |
#envira-gallery-35 .envira-gallery-item span.title { | |
padding: 20px 5px 30px; | |
text-align: center; | |
display: block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how i can add Image Counter below thumbnails?
like this http://enviragallery.com/docs/image-counter-to-album-lightbox/