Missing image dimensions for Hover Img - by Royalty

This topic has 15 replies, 3 voices, and was last updated 6 years, 9 months ago ago by Laranz

  • Avatar: Royalty
    Royalty
    Participant
    July 14, 2017 at 16:51

    Hello,
    GTMetrix told me to “Specify image dimensions”. I checked the listed images and noticed that only the hover images (the images that appear on shop catalogue page when I hover over the featured image) dont have image dimensions. The featured images do have image dimensions and are using src, as is should be. Why isnt it the same with the hover images? Also, it always loads the full size image, not the smaller catalogue-size-version.
    Is it possible to fix this in the next update and to tell me how to fix it now?
    Many thanks in advance!

    14 Answers
    Avatar: laranz
    Laranz
    Participant
    July 16, 2017 at 23:11

    Hi,

    Can you show us the URL of the website where this issue occurs? If you want that private, use private content.

    Let us know,

    Thanks,
    laranz.

    Avatar: Royalty
    Royalty
    Participant
    July 18, 2017 at 06:46

    It happens on every page with royal theme and hover/swap images enabled. Please find my page in private content. Thank you.

    Please, contact administrator
    for this information.
    Avatar: laranz
    Laranz
    Participant
    July 18, 2017 at 09:35

    Hi,

    Can you pass me the WP/FTP Login details in a private reply, so that I check that on your website?

    Let us know,

    Thanks,
    laranz.

    Avatar: Royalty
    Royalty
    Participant
    July 18, 2017 at 13:35

    The issue has nothing to do with my website, it happens on all websites using Royal theme. To clarify what I mean, I have added some details in private content as I dont want my url or screenshots of my page to be public. Thank you.

    Please, contact administrator
    for this information.
    Avatar: laranz
    Laranz
    Participant
    July 19, 2017 at 03:50

    Hi,

    Yes, I ask the details to check the fix in your website. 🙂 If you give I will change the code that will fix that.

    Let us know,

    Thanks,
    laranz.

    Avatar: Royalty
    Royalty
    Participant
    July 19, 2017 at 08:01

    Ok but this will take a few hours as I am not at the computer right now. Isnt it possible to post the required changes here, so others can profit too?
    Thank you.

    Avatar: Royalty
    Royalty
    Participant
    July 19, 2017 at 09:02

    Please find ftp credentials in private content.
    Many thanks in advance.

    Please, contact administrator
    for this information.
    Avatar: Royalty
    Royalty
    Participant
    July 21, 2017 at 08:08

    As I did not get any answer, I just added width="420" height="420" to the hover img tag in content-product.php. That solved the GTMetrix advice but I guess that this is not the best solution, right? What would you suggest?

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    July 21, 2017 at 14:17

    Hello,

    Sorry for the delay.
    Please use your variant as temporary solution. It will be fixed in new theme update.

    Regards

    Avatar: Royalty
    Royalty
    Participant
    July 21, 2017 at 14:18

    Great news, thank you!
    When will the update be out?

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    July 21, 2017 at 15:22

    Hello,

    We’re waiting for news from our developers as they are still working on the update.

    Regards

    Avatar: laranz
    Laranz
    Participant
    July 24, 2017 at 04:27

    Hi,

    Instead the changes you made, you can use this

    <?php if ($hoverUrl != ''): ?>
    						<img src="<?php echo $hoverImg['url']; ?>" width="<?php echo $size['width'] ?>" height="<?php echo $size['height']  ?>" alt="<?php the_title(); ?>" class="show-image">
    					<?php endif ?>

    it is more elegant way, but we already take this in to developers so they will fix this up in the upcoming updates.

    PS: I tried to change that in the FTP, but it didn’t reflect in the front-end, I think there is some cache. So I pass the solution to you instead.

    Let us know,

    Thanks,
    laranz.

    Avatar: Royalty
    Royalty
    Participant
    July 24, 2017 at 09:55

    Yes, there is W3Total Cache enabled. I added your code and it works, thank you very much!

    Avatar: laranz
    Laranz
    Participant
    July 24, 2017 at 09:56

    Hi,

    Glad we helped. 🙂

    Let us know if you have any other questions,

    If you’re happy with our service, don’t forget to rate us 5 stars in themeforest. 🙂

    Thanks,
    laranz.

  • Viewing 15 results - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.