Archived topic
Page Hero Not Scaling
5 replies · Started by John on June 25, 2022
Hi!
Re: https://origami33stg.wpengine.com/
I have a page hero image on this site that is cut off on the left and right, so the full image isn't seen.
I added a home-hero class and CSS, but no luck.
---------------------
Original image dimension in px: w:1550 h:292
Aspect ratio: 292 / 1550 = 0.1883870968 x 100 = 18.83
--------------------
Simple CSS:
.home-hero {
min-height: 19vw;
}
Thanks!
John
PS: Caches Cleared
Hi there,
Background images aren't responsive by nature - it isn't something the theme can control.
If you are trying to replicate this site here: https://www.origamispirit.com/
Then that image should be added as the site logo in the customizer:
https://docs.generatepress.com/article/adding-header-logo/
Hi Leo,
I added the image as the site logo in the customizer. That works perfectly for a logged-out user.
What if I wanted to change that site logo/image for a logged-in user?
How is that done?
Thanks!
John
Hi John,
You can try this filter:
add_filter( 'generate_logo', function( $logo ) {
if ( is_user_logged_in() ) {
return 'URL TO ENGLISH LOGO';
}
return $logo;
} );
Replace the URL TO ENGLISH LOGO with the logo URL that you want to show for logged-in users.
Thank you, Ying!
You are welcome :)