Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #241038

    Hi. I am developing this page: http://www.kitm.se/sv/
    As you see, I have a bigger image in the header than recommended default size.
    Is it possible to have another smaller image that is shown only when a mobile is used?
    Thanks
    Abedia

    #241906

    Hey Abedia!

    You’d need to edit /includes/helper-main-menu.php, try adding this after line 101:

    echo avia_logo('_YOUR_MOBILE_LOGO_URL_GOES_HERE_', $addition, 'span', true);
    

    Then, add this to the Quick CSS:

    @media only screen and (min-width: 768px) {
      span.logo{
      	display: none;
      }
    }
    
    @media only screen and (max-width: 767px) {
      strong.logo{
      	display: none;
      }
    }

    Best regards,
    Josue

    #242229

    Hi

    I did exactly as you suggested. I inserted the code in Quick CSS and lines 101 and 102 look like this:

    echo avia_logo(AVIA_BASE_URL.’images/layout/logo.png’, $addition, ‘strong’, true);
    echo avia_logo(‘http://www.kitm.se/logo2.jpg’, $addition, ‘span’, true);

    But I don’t see the smaller logo in my smart phone yet. It is located here: http://www.kitm.se/logo2.jpg

    Have I done something wrong?

    Regards
    Abedi

    • This reply was modified 10 years, 8 months ago by abedia.
    #242235

    Hi :)

    Shall we mark the thread as resolved?

    Regards,
    Yigit

    #242245

    No, please read my previous message again. Thank!

    #242278

    Hey!

    Change the second “echo avia_logo..” to:

    echo '<span class="logo"><a href="http://www.kitm.se/sv/"><img height="100" width="300" src="http://www.kitm.se/logo2.jpg" alt="Svenska Föreningar för Klinisk Immunologi och Transfusionsmedicin"></a></span>';
    

    Regards,
    Josue

    #242287

    I see now the logo but it is stretched. I changed the size (340×156) to the default size with a new image name (logo2.jpg). Now the line looks like this:

    echo ‘<span class=”logo”>Svenska Föreningar för Klinisk Immunologi och Transfusionsmedicin</span>’;

    But the image is not shown correctly. How is in your smart phone? I use Samsung S3.

    Regards
    Abedi

    • This reply was modified 10 years, 8 months ago by abedia.
    #242288

    Hi!

    Try adding this code too:

    span.logo{
    width: 220px !important;
    }

    Result:

    Best regards,
    Josue

    #242293

    Thanks, now it works fine. Just a question: What is the best size for logo for smart phone? Is it the default size which is 340×156 or the width should be 220 as I see in the last code?

    • This reply was modified 10 years, 8 months ago by abedia.
    #242313

    Hi!

    The smartphone width screen is usally 340 but in this case it would be better to have it smaller because of the navigation button on the right.

    Cheers!
    Josue

    #242314

    Thanks for your excellent support!

    Regards
    Abedi

    #242317

    You are welcome, glad we could help :)

    Regards,
    
Josue

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Smaller image in the header that is shown only when a mobile is used?’ is closed to new replies.