In Beautiful Pro the .site-header-banner div has background image set via CSS and as such is not responsive. It is possible to make image backgrounds responsive but I personally prefer to just "embed" images vs using them as backgrounds and using CSS/JS to make them responsive. Just feels more natural and the proper way of doing things.
In this article I show how we can disable the background image option in Beautiful Pro and modify functions.php to insert a image present in child theme's images directory in the .site-header-banner div.
Desktop:
Tablet:
Mobile:
Edit functions.php.
Comment out or delete
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
You are my hero!!!. I have been trying this for weeks. Thank you so so much.
Awesome!!! Could not find an answer in the forums and here you have it! Fantastic!
This is great! With your instructions, I was finally able to finish the redesign for my blog! Thank you.
One small adjustment – right now the banner is left justified – is there a way to make it so the banner stays centered on all devices?
Add this in style.css:
.site-header-banner {
text-align: center;
}
.site-header-banner img {
width: 100%;
}
Thank you, Sridhar, that last bit of code worked perfectly.
My redesign is done work is done. Time to move my content over from my old site, then it’s relaunch time!
Wow! Thank you Sridhar!! Just what I was looking for!
Hi Sridar,
Thanks for the tutorial. Worked really well. But I have a problem with white space/padding under the responsive banner that increases when viewed on smaller screens. Do you have a suggestion to remedy this please?
http://ruapehu2.helpmenet.co.nz/
Many thanks,
Anna
I see 200px height being set for “.beautiful .site-header-banner” via custom.css. You may want to remove that.
Thanks so very much
Hi There. Great tutorial. Do you have any suggestions for making the Main Pictures on the Home Page of the Parallax Pro theme responsive?
For some reason the pictures chop off when viewing on mobile.
Here is the theme in question: http://my.studiopress.com/themes/parallax/#demo-phone
I’m not seeing the last bit of code you say to replace: echo ”;
All I have left after commenting out first part of instructions is:
//* Add custom background callback
function voter_background_callback() {
$background = get_background_image();
$color = get_background_color();
if ( ! $background && ! $color )
return;
echo trim( sprintf(
“.custom-background .site-header-banner { background: %s %s %s %s %s; } “,
$background ? ‘url(‘. $background .’)’ : ”,
$color ? ‘#’. $color : ‘transparent’,
get_theme_mod( ‘background_repeat’, ‘repeat’ ),
get_theme_mod( ‘background_position_x’, ‘left’ ),
get_theme_mod( ‘background_attachment’, ‘scroll’ )
) );
}
I followed the instruction in the tutorial, but now instead of my banner showing, there is a small photo icon. I’ve triple checked my entries and can’t figure out where I went wrong. Any suggestions? Thanks!
alisonmclennan.com
@Alison
Seems to be working fine: http://cl.ly/image/0y1g01043X33
Can you show a screenshot of the problem?
Yes, I figured it out, thanks! It was a the image name causing a broken link. Thanks!
I do have one other question, though. I’ve removed my header/site title and am using only the custom banner. How can I make it responsive so that if someone wants to go to my home page, they can get there by clicking on the banner?
http://pastebin.com/raw.php?i=K9J0nJbA
You might want to ensure that there are no spaces in file names.
i.e., rename “Banner2015 copy.jpg” to “banner2015-copy.jpg”
any idea if this is applicable to Foodie Pro with too much adjustments? got a question to apply this to Foodie Pro but don’t have a copy of the theme to try it out.
It should work. If it it doesn’t, we will make it work. Take it up.
sounds awesome! 🙂
apparently it’s not the exact same thing as here… he’s looking to replace the text header with a responsive full width logo and still use the “header right” widget area.
Not sure wether this would help.
nevertheless I’ve sent a price for the adjustment 🙂
Hi there,
Just followed your tutorial but had a slight issue. I could see that the banner had gone, but I was not seeing the new banner.. Apparently there was some coding that is not mentioned in the above that needed to be done.
commented out the 2 lines just before the “echo ”;”
”’/*if ( ! get_background_image() )
return;*/”’
A friend from Slack kindly had a look at my functions file and did the above and the banner then came through.
Thought it would be worth mentioning.
thanks
Steff
Thanks. Updated tutorial.
Hi Sridhar,
For a reason I ignore, I’ve been able to put that in place once and it worked perfectly.
But now i try again and the banner won’t show up at all. I’ve followed everything. Have ever written the full url for the image path but no banner at all..
What could be the problem?
Thanks.
Can you
1) paste the code present in your theme’s functions.php at http://www.pastebin.com and give the link?
2) provide the URL of your site?
I have updated the tutorial. Can you try the updated steps?
Hi Sridhar,
As said on Facebook, with the new code it’s working 🙂
Thanks for having updated the tutorial!
This code is a lifesaver. Thank you!!!