Remove image in header
I want to use a transparent image for my header,and since the upload converts the file in png I did this through custom css :
Works fine, however I am left with a with an empty src in the header, which for one this is not good coding practice, and more importantly displays a blue question mark on Android browser.
How can I get rid of the img tag ? I don’t have much knowledge of php and how a theme works.
PS : I’m using a child theme (only installed it though, doesn’t do anything yet), maybe a line of code in the function.php to strip out this tag ?
PS: website is http://scuba-college.eu. If you try it now on Android you won’t see the question mark, cause I temporarely solved the problem by putting a fake header image and apply “display:none” to it through custom css. Not a very clean solution though, so I would prefer to completely remove the img tab
AnonymousJune 8, 2012 at 10:52 pm #29084
.png’s can be transparent.
Are you creating the image yourself?
AnonymousJune 10, 2012 at 12:03 pm #29086
Copy the header.php file to your child theme and modify it to your preferences.
AnonymousJune 11, 2012 at 6:53 am #29088
That is correct. You can keep an eye on the themes changelog to see if any modifications where made to the header file.
Also, if you want to be VERY precise, you can download a program which will compare two files and note the differences. I forget the name of it, but I’m sure you can find one if you search around.
Then, compare the new header.php of the new version to your current one before installing the update. Overkill… but this will ensure you are kept current with your header.php file.
AnonymousJune 11, 2012 at 7:09 am #29089
Why can’t you just remove
graphene_header_imagefilter using a child theme?
Or am I missing something??
Yes, this is what I did for now. However, as we are discussing it with Ken, this means that I will not get the updates for the header if they are any, as I will be using my own header.php file in my child theme.
As Ken suggests I could check the new versions for any change, but that’s a lot of hassle for one thing, and for the other I’m doing this site for someone else who will not be able to do so.
So my best bet would be to add a function in function.php that strips the image in the header, but I don’t know enough php to do this, so I’m asking if you know what function I can write.
Hope this makes my request more clear, thanks for your patience 🙂Admin
I think what Prasanna meant was that you can just use the
graphene_header_imagefilter hook to replace the header image with your own image, bypassing the WordPress Custom Header feature completely.
In your child theme’s
add_filter( 'graphene_header_image', 'graphene_custom_header_img' );
You must be logged in to reply to this topic.