Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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

    #1413679

    Hey 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,
    Ismael

    #1413805

    Thanks Ismael, please see https://img.savvyify.com/image/jfRU for screenshot with yellow bit highlighted I want to hide. Thank you.

    #1414073

    Hi,
    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,
    Mike

    #1414098

    Thanks 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!

    #1414113

    Hi,
    It didn’t leave a gap in my test, so I will need to see your page
    Enfold_Support_2615.jpeg

    Best regards,
    Mike

    #1414115
    This reply has been marked as private.
    #1414117
    This reply has been marked as private.
    #1414130
    This reply has been marked as private.
    #1414131

    Hi,
    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,
    Mike

    #1414186

    That worked perfectly! Thankyou so much.

    #1414224

    Hi,
    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

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Hide text/colour background area if there’s no Title in Masonry Gallery’ is closed to new replies.