Tagged: x
-
AuthorPosts
-
January 4, 2017 at 12:06 am #1315310
Hi guys,
Trying to add title/text under each photo in Envira gallery but couldn’t find such an option. Just like this gallery here (check screen grab) : https://travelcrestedbutte.com/crested-butte-snow-report/
Is that possible?
working on: http://www.enjoycrestedbutte.com/the-crested-butte-snow-report/
Thank you!
January 4, 2017 at 1:40 am #1315392Hi there,
Thanks for writing in! It’s possible if you use the default WordPress Gallery. If you need to show caption for Envira Gallery under the thumbnail, you can follow this – http://enviragallery.com/docs/display-image-captions-thumbnails/
Cheers!
January 4, 2017 at 8:28 am #1315774Great! Thank you so much for the help!
Was able to enable to title but noticed some misalignment when viewed on smaller screen. Is it possible to fix that?
January 4, 2017 at 10:11 am #1315964Hi there,
Thanks for writing in! I can help with that. You can actually decrease the font size for smaller screens to keep it in single line. You can add this under Custom > CSS in the Customizer.
@media only screen and (max-width: 480px) { .envira-gallery-item-inner .caption { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: pre; width: 100%; } }
You can change the max-width and font-size if needed.
Cheers!
January 4, 2017 at 3:16 pm #1316391That’s a nifty little trick! Thank you for the great support!
January 4, 2017 at 10:06 pm #1316863You are most welcome. 🙂
January 19, 2017 at 5:15 pm #1337456Hi,
Another question about captions under the images came to mind:
1) How could I change the code below to make it on a global level (the code was taken from the link above: http://enviragallery.com/docs/display-image-captions-thumbnails/)
#envira-gallery-321 .envira-gallery-item span.caption { padding: 0% 1% 3%; text-align: center; display: block; } .envira-gallery-item-inner .caption { white-space: pre-line; margin-top: 10px !important; }
Pretty much looking to make the following line apply globally instead only to the specific gallery:
#envira-gallery-321 .envira-gallery-item span.caption {
Thank you!
January 19, 2017 at 9:32 pm #1337758Hello There,
Please remove the #envira-gallery-321. Something like this:
.envira-gallery-item span.caption { padding: 0% 1% 3%; text-align: center; display: block; } .envira-gallery-item-inner .caption { white-space: pre-line; margin-top: 10px !important; }
Hope this helps.
January 20, 2017 at 9:03 am #1338390Awesome! Thank you so much!
January 20, 2017 at 10:30 am #1338512You’re most welcome!
Let us know if we can help with anything else.
Thanks!
March 13, 2017 at 11:34 pm #1405871Hi guys,
Just ran into an issue on this topic!
Updated the code below which is located in envira-gallery-image-captions.php in wp/contents/plugins and it breaks the website. Am I missing something?
// IDs of galleries to display captions on $galleriesToShowCaptions = array(358, 321, 632, 758, 2494, 2479, 2465, 2463, 2443, 2440, 2426, 2420, 2415, 2401, 2384, 2369, 2366, 2347, 2344, 2329, 2326, 2310, 2309, 2297, 2294, 2272, 2269, 2238, 2234, 2207, 2204, 2177, 2175, 2160, 2156, 2140, 2134, 2121, 2103, 2102, 2058, 2059, 2032, 2053, 2017, 2027, 1988, 2015, 1981, 1960, 1957, 1941, 1935, 1912, 1906, 1890, 1885, 1871, 1861, 1849, 1843, 1776, 1580, 1547, 830, 812, 758, 632); // Check if we need to display captions on this gallery if ( !in_array( $data['id'], $galleriesToShowCaptions ) ) { return $output; } if ( isset( $item['caption'] )) { $output .= '<span class="caption">' . $item['caption'] . '</span>'; } return $output; } add_action( 'envira_gallery_output_after_link', 'envira_gallery_image_captions', 10, 5 );
p.s. the code is inactive at the moment (need to keep the website running)
By the way, also noticed that Envira gallery has added an options to display the title under the image in the config area, which is currently missing in the version Theme X is currently using… http://enviragallery.com/docs/display-image-captions-thumbnails/
March 14, 2017 at 8:53 am #1406390Hi There,
Would you mind giving us FTP credentials so we can check the file envira-gallery-image-captions.php?
Please note that not all options and functionalities are available on the addon.March 14, 2017 at 9:29 am #1406449This reply has been marked as private.March 14, 2017 at 11:28 am #1406690Hi There,
When you say inactive, did you mean you remove the file totally or just commented the code? I am able to check but cannot find the file. This means you remove it then? So I can check it at the moment. Just make sure that you have completely copied the code correctly. Above code is incomplete. You may compare to this:
https://gist.githubusercontent.com/n7studios/ca189994931fcad5aa77/raw/bb26568776030505e22e2fee55b4f1317931fdea/envira-gallery-image-captions.phpHope this helps.
March 14, 2017 at 11:07 pm #1407544Hi, the code was commented out but using the one you provided to compare to works! Just copied the # of the gallery from the first code. This is what is working:
function envira_gallery_image_captions( $output, $id, $item, $data, $i ) { // IDs of galleries to display captions on $galleriesToShowCaptions = array( 391, 392, 358, 321, 632, 758, 2494, 2479, 2465, 2463, 2443, 2440, 2426, 2420, 2415, 2401, 2384, 2369, 2366, 2347, 2344, 2329, 2326, 2310, 2309, 2297, 2294, 2272, 2269, 2238, 2234, 2207, 2204, 2177, 2175, 2160, 2156, 2140, 2134, 2121, 2103, 2102, 2058, 2059, 2032, 2053, 2017, 2027, 1988, 2015, 1981, 1960, 1957, 1941, 1935, 1912, 1906, 1890, 1885, 1871, 1861, 1849, 1843, 1776, 1580, 1547, 830, 812, 758, 632 ); // Check if we need to display captions on this gallery if ( !in_array( $data['id'], $galleriesToShowCaptions ) ) { return $output; } if ( isset( $item['caption'] )) { $output .= '<span class="caption">' . $item['caption'] . '</span>'; } return $output; } add_action( 'envira_gallery_output_after_link', 'envira_gallery_image_captions', 10, 5 );
-
AuthorPosts