Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1017629

    Hello,

    I have a larger image size 1200px by 1800px or so, and it is getting sized down when being opened via lightbox. It is a longer restaurant menu, and I really need it to show full-size. I tried one of Ygit’s methods (found on another thread) – which was going into media settings and increasing large thumbnail size to max, and then refreshing(rewriting?)thumbnails via a plugin. So far nothing has worked. Do this have to be accomplished via functions.php ? I’ve had my site crash when I’ve tried editing this before so not sure what I do wrong usually lol..

    So, the issue is on the homepage, under dinner menu, both the links just under the fold, and the menu item called ‘dinner’ at the top is where I’d like to bring up the full-sized menu image if possible, on click. The lunch menu looks great, the dinner menu is coming in a little shrunk which makes the text hard to read. The mobile version you can just read, so the ability to just set the lightbox size on desktop would be beneficial too as well.

    #1018548

    Hey artisforever,
    I took a look at your menu, the middle link, and found the true size of it 1200px-1976px and wrote this css:

    img.mfp-img {
        width: 1200px !important; 
        max-width: 1200px !important;  
        height: 1976px !important;
        max-height: 1976px !important;
    }

    to show it at full size, which works. But you will need to add a ID to the element and to the css so that it will be the only image that opens at that size. You can then take similar steps to load your other images at full size.
    Unfortunately I was not able to login to your site. Please check.

    I foresee an issue with this for mobile screens, I’m thinking this code should only be used for desktops.

    Best regards,
    Mike

    #1019096

    Hi Mike,

    Thanks for getting back to me. I haven’ tried this yet as I’m not positive how to add an ID to that media element? My top menu navigation also utilizes the dinner menu. Each just opens the dinner menu by pulling the images URL location.

    Thank you!

    #1019306

    Hi,
    I tried to login to assist but the password is not working for me, please check.
    Ok, so I thought it though a little more and think we should add a class to the image on click so we can target the one image with the css. This works in my tests.
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    function add_menu_img_class(){
      ?>
      <script>
    (function($){
    $(document).click(function() {
      $("img[src*=LargeMenuSept19_OL-web-ready-update]").addClass("LargeMenu");
      });
    })(jQuery);
    </script>
      <?php
      }
    add_action('wp_footer', 'add_menu_img_class');

    then add this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:

    img.mfp-img.LargeMenu {
        width: 1200px !important; 
        max-width: 1200px !important;  
        height: 1976px !important;
        max-height: 1976px !important;
    }

    This will add a class to only the one image so the css can target just the one image. If you change the image you will need to change the script. You can also use this to model for your other menu, you will need to change the function, script, and css to the other image.

    Best regards,
    Mike

    #1055694

    Hi Mike,

    So, I wanted to get you an updated sign-in with before I try this (Below in private content). Any functions.php edits I have done have always crashed my website, haha, I’m not positive what I do wrong usually…but I usually have to have my host restore it… so I am a little weary of your recommendations before you have access.

    The goal would be to open an single image via lightbox upon click, at the actual size I uploaded it at, even if clicked upon via the main menu nav.

    One issue I’m running into, is that I can only add the wp/upload… url to have my nav open up the image vs. just having the regular image open up in lightbox. I did try to download a new lightbox plugin after disabled the default lightbox (via enfold options), but I could not even get any of the new plugins to work or show up on my images.

    Thanks again for any help, really trying to get this right for my family’s business.

    #1055740

    Hi,
    Sorry the login didn’t work for me. Please see the login I tried in the Private Content area.
    It would be best to also have ftp access when editing the functions.php, because if the site goes down you can still correct the functions.php file via FTP.
    If you can include admin login & ftp access in the Private Content area I could be of more assistance.

    Best regards,
    Mike

    #1056803
    This reply has been marked as private.
    #1057012

    Hi,
    Thanks for the new login, I was able to login to your site, but I couldn’t FTP in, it said I was logged in but it would not give me a directory list and then it would time out. After a few tries I got the error that I had too many connects, so I’ll try again later.
    I took a look at your lightbox plugins but I didn’t see that any of them said that they would show a larger than screen image, or actual size.
    I tested the script & css that I had posted above in a code block on your page to make the two menus actual size and it works when you open the images in lightbox, but not if you try to navigate to the next image, so I hid the lightbox arrows for those two images.
    Please give it a try, and if you don’t like it just delete the code block that is under the first color section.
    Perhaps there is a plugin that will do this, but I didn’t find one.

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.