Tagged: Masonry Gallery
-
AuthorPosts
-
July 19, 2023 at 3:12 am #1413660
Hi,
I have a Masonry Gallery that is set to Always Display the Excerpt which works well but I have images that don’t have any Excerpts and I’d like to hide the background text colour area (where the text usually goes below the image with the wee up arrow) when so. Is there a way with some code wizardry?
Thank you
July 19, 2023 at 9:39 am #1413679Hey laurastenhouse,
Thank you for the inquiry.
We may need to inspect the site or see some screenshots in order to provide an appropriate solution. Please post the site URL in the private field. For the screenshots, you can use platforms like Savvyify, Imgur or Dropbox. Here are the steps to follow:
1.) Visit the website of your chosen platform, such as Savvyify, Imgur or Dropbox.
2.) Locate the option to upload a file or an image.
3.) Select the screenshot file from your computer or device and upload it to the platform.
4.) After the upload is complete, you will be provided with a shareable link or an embed code.
5.) Copy the link or code and include it in your message or response to provide us with the screenshot.Thank you for taking the time to share the screenshot. It will help us better understand the issue you’re facing and provide appropriate assistance.
Best regards,
IsmaelJuly 20, 2023 at 9:25 am #1413805Thanks Ismael, please see https://img.savvyify.com/image/jfRU for screenshot with yellow bit highlighted I want to hide. Thank you.
July 22, 2023 at 8:48 pm #1414073Hi,
Thanks for the screenshot, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function hide_masonry_gallery_excerpt_if_empty() { ?> <script> (function($){ $('.av-masonry-gallery .av-masonry-entry').each(function() { if ($(this).find('.av-masonry-entry-content').length === 0) { $(this).find('.av-inner-masonry-content.site-background').css({"background-color": "transparent"}); $(this).find('.av-inner-masonry-content .avia-arrow').css({"background-color": "transparent"}); } }); })(jQuery); </script> <?php } add_action('wp_footer', 'hide_masonry_gallery_excerpt_if_empty');
Best regards,
MikeJuly 23, 2023 at 6:54 am #1414098Thanks so much Mike. It worked great but it has left the space for the excerpt visible under the image (see https://img.savvyify.com/image/jNXx) – is there any way to remove this gap?
Cheers!July 23, 2023 at 1:09 pm #1414113July 23, 2023 at 1:26 pm #1414115This reply has been marked as private.July 23, 2023 at 1:28 pm #1414117This reply has been marked as private.July 23, 2023 at 1:54 pm #1414130This reply has been marked as private.July 23, 2023 at 1:56 pm #1414131Hi,
Thanks, try this code instead:function hide_masonry_gallery_excerpt_and_padding_if_empty() { ?> <script> (function($){ $('.av-masonry-gallery .av-masonry-entry').each(function() { if ($(this).find('.av-masonry-entry-content').length === 0) { $(this).find('.av-inner-masonry-content.site-background').css({"background-color": "transparent","padding": "0"}); $(this).find('.av-inner-masonry-content .avia-arrow').css({"background-color": "transparent"}); } }); })(jQuery); </script> <?php } add_action('wp_footer', 'hide_masonry_gallery_excerpt_and_padding_if_empty');
Best regards,
MikeJuly 24, 2023 at 2:53 am #1414186That worked perfectly! Thankyou so much.
July 24, 2023 at 12:23 pm #1414224Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Hide text/colour background area if there’s no Title in Masonry Gallery’ is closed to new replies.