-
AuthorPosts
-
February 4, 2021 at 1:22 pm #1277686
Hello at Kriesi,
I have builded a masonry gallery where the caption shows on hover as overlay. Great. Additionally I want to have a caption below each image. I was thinking about the ALT-tag or the copyright-tag of the image but do not have the coding skills to implement this in the functions.php of my child theme. Can you help?
Thanks.February 4, 2021 at 1:29 pm #1277692Hi Sigmund,
Thanks for contacting us!
Could you please post a screenshot showing the changes you would like to make? You can upload your screenshots on imgur.com and share the links here :)
Best regards,
YigitFebruary 4, 2021 at 1:40 pm #1277699Hi Yigit,
sure, here it is: https://imgur.com/a/axNuvmwBest
February 4, 2021 at 3:23 pm #1277732Hi,
– Please refer to this post – https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb and add the code in functions.php file of your child theme
– Copy /enfold/config-templatebuilder/avia-shortcodes/av-masonry-helper.php file to your child theme inside /shortcodes/ folder
– Find following line$bg = '<div class="av-masonry-outerimage-container">' . $img_before . '<div class="av-masonry-image-container" ' . $img_style . $outer_title . $outer_alt . '>' . $img_html . '</div></div>';
– Change it to following
$bg = '<div class="av-masonry-outerimage-container">' . $img_before . '<div class="av-masonry-image-container" ' . $img_style . $outer_title . $outer_alt . '>' . $img_html . '</div></div><span class="masonry-name-field">'. esc_attr( $alt ) .'</span>';
It would display alt text :)
Best regards,
YigitFebruary 4, 2021 at 4:20 pm #1277744Hi Yigit,
I have done as you said and double checked. It does not work. Even when I copy it in the original av-masonry-helper.php it does not work. Can you have a look?Best
February 5, 2021 at 1:04 pm #1277973Hi,
I adjusted the code in .av-masonry-helper.php file and then added following code to Quick CSS in Enfold theme options > General Styling
.masonry-name-field { display: block; position: fixed; bottom: 0; color: white; } .av-fixed-size .av-masonry-outerimage-container { bottom: 15px; } .av-fixed-size .av-masonry-entry .av-inner-masonry-content, .av-caption-on-hover .av-masonry-item-with-image.av-masonry-entry .av-inner-masonry-content { bottom: 14px; }
Please review your website :)
Best regards,
YigitFebruary 5, 2021 at 1:48 pm #1277992Great, Yigit, that looks great. Thanks for the support. You can close the topic, if you want.
BestFebruary 5, 2021 at 2:25 pm #1278015 -
AuthorPosts
- The topic ‘Masonry gallery with Extra Caption below image’ is closed to new replies.