-
AuthorPosts
-
July 2, 2021 at 6:40 pm #1308537
Hi there,
I use my website to display my illustrations portfolio, see here: https://www.suemasondesign.com/picturebooks/
Most of the thumbnails of the Masonry gallery in my portfolio are blurred, whereas the actual enlarged pic is sharp. Strangely however some of the thumbs are NOT blurred!
I have tried several plugins to sort this, to no avail.
Please help – maybe with a code in functions.php?Thank you!
July 3, 2021 at 10:09 pm #1308603Can anybody help please?
July 4, 2021 at 8:07 pm #1308663Hi,
Thank you for your patience, and the link to your site, when I compare the actual image & it’s thumbnail I see a slight difference, but I’m not sure what may cause this. It looks like you are using the masonry element, please try creating a test page using the masonry gallery element, it seems to offer multiple image sizes on page load that may help.Best regards,
MikeJuly 5, 2021 at 10:57 am #1308750Thanks for this,
Mike.
I created a test page, see here: https://www.suemasondesign.com/test/
Again, the thumbs are blurred.
Any other ideas?
Thank you,
SusanneJuly 6, 2021 at 1:47 pm #1308938Hi,
Thank you for trying the masonry gallery element, I see that the same issue with the WordPress created thumbnails is occuring, I’m not sure why. As I look at your /picturebooks/ page again, I almost believe that the images are correct until you hover over them and then they are blurry, please check again and see if you also believe this, if so we can investigate the css:.avia_desktop .av-masonry-entry:hover .av-masonry-image-container { -webkit-transform: scale(1.05,1.05); transform: scale(1.05,1.05); }
But if you don’t think this is true, then I wrote this script for the /picturebooks/ page that will replace your thumbnails with the original image that is linked in the lightbox for you to try. Try adding this code to the end of your functions.php file in Appearance > Editor:
function custom_masonry_img_script() { ?> <script> (function($){ $("#top.page-id-937 .av-masonry-entry").each(function(){ var imageUrl = $(this).attr("href"); $(this).find(".av-masonry-image-container img").attr("src", imageUrl); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_masonry_img_script');
Best regards,
MikeJuly 8, 2021 at 4:18 pm #1309277Hello Mike,
Thank you for the code.
I tried to insert it on different functions.php pages: one in wp-includes, one in Enfold and the one in Enfold.child.
In all 3 cases, the website crashed and this message appeared:
There has been a critical error on this website.So, no success, alas!
Anyway, thank you for you time!July 9, 2021 at 12:28 pm #1309379Hi,
You would add the function to your child theme functions.php, but please copy the code from the website and not an email and when you paste the code ensure that the arrows in the code are not changing to <
or perhaps there is some other code error in your functions.php, if you include an admin login in the Private Content area I could take a look.
Another way to add the code is by adding a code block element to your page and adding this part of the code:<script> (function($){ $("#top.page-id-937 .av-masonry-entry").each(function(){ var imageUrl = $(this).attr("href"); $(this).find(".av-masonry-image-container img").attr("src", imageUrl); }); })(jQuery); </script>
Best regards,
MikeJuly 9, 2021 at 2:54 pm #1309406Hi Mike,
Thank you so much for all your effort.
I give you the login details below – could you please try to insert the code? Or do you need access to cpanel on the server?
SusanneJuly 10, 2021 at 5:34 pm #1309497Hi,
Thank you for the login, I added the code to a code block element on the /picturebooks/ page and the images are now being replaced on that page, please clear your browser cache and check.Best regards,
MikeJuly 10, 2021 at 7:24 pm #1309502Fantastic work, Mike. Thank you so much!
It looks so much better now.
Best wishes,
SusanneJuly 10, 2021 at 9:17 pm #1309510Hi,
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 ‘Resolving blurred thumbnails on Masonry’ is closed to new replies.