I am using the genesis framework and I want to support a header image within my child theme. I want to change the position of the image that i uploaded to be the header image.
I added this line of code within my functions.php:
add_theme_support( 'genesis-custom-header', array( 'width' => 213, 'height' => 300) );
Genesis now generates css code for the .site-header within the front page:
.site-header { background: url(http://localhost:8888/studio/wp-content/uploads/2014/09/my_logo.png) no-repeat !important; }
I want to change this code, as i want to apply some other CSS stuff to my <header>
like background-position
, background-size
etc. I saw in the official documentation that I can use 'header-callback'
within add_theme_support, but how does it work exactly? How do i have to write my callback function that WP automatically changes the code which is generated for .site-header
as above?
If i change .site-header
within my style.css
file it changes nothing. It has to be generated as above, but how?
Thanks!
CSS written in style.css should override default style! Are you sure mark-up are the same?
You can try to use ‘!important’ declarations in css value to give priority, example
Also, you can add more values to custom header array:
And style your logo with:
Please note that this snippet works if you are using child theme (as I think)
Hope it helps 😉
Francesco