Archived topic
Margin image header on tablet and mobile
7 replies · Started by Leyre on April 9, 2017
Hello
I have a problem with the header image when viewed on a tablet or mobile phone. I've put 240px on top so that the whole image is seen but in the version of tablet and mobile is much space. How can I solve it?
This is the image
http://leyrecatalan.com/
Hi there,
I would try adding that image using GP's page header add-on:
https://docs.generatepress.com/article/page-header-overview/
or use the after header content hook with a conditional tag so it would be responsive:
<?php if ( is_front_page() ) { ?>
<img src="https://IMAGE-URL-HERE">
<?php } ?>
http://demo.generatepress.com/hook-locations/
https://docs.generatepress.com/article/hooks-overview/
Make sure execute PHP is checked.
Let me know if this works for you.
The problem I have now is that you only see a part of the image. http://leyrecatalan.com/
If I change the height of the image it stops being adaptable. What can I do? Thanks for your answer
I would still recommend using one of the methods above to insert your image. It should solve your problem. Can you give it a shot?
You could also try using the percentage unit for your padding inside the page header instead of px.
Yes. In the end I have done this and it has worked. Thank you very much
No problem :)