• Hello all,
    im just testing wordpress a bit – it’s very nice software – but i had the following question:

    i wanted to change my headerimage to a gif file, so the edges could be transparent (cause i use a pattern as a background wallpaper – so the round corners would come out pretty) – i went to the header.php file and i changed the line that specifies the location -> “kubrickheader.jpg” to “kubrickheader.gif” – but it keeps displaying the jpg file.
    im fairly sure there’s nothing wrong with my gif?

    what should i change or do to make it work? am i overlooking something?

    thanks a lot in advance!

    ps; im fairly new to it – but i have some basic php/css/html/js knowledge – and i hope also didn’t missed anything about this in the docs..

Viewing 14 replies - 1 through 14 (of 14 total)
  • Can you provide the link to where you are doing this change?

    I tried the link from your username, but ended up with “Problem loading the page error” in Firefox

    Thread Starter miw

    (@miw)

    im doing it on my local computer, just testing – the site that is referred in my user profile is not yet up yet ?? – im mainly testing/learning how to use wordpress right now.

    it’s a completely fresh wordpress install.. so i don’t know what could be wrong with it – if i rename my own header to kubrickheader.jpg one, it does change.. (but i need the gif capabilities)..

    There are a couple of instances where the image name is defined/used in the default theme.

    Make sure you are changing all instances of the image name, in the code (if used) and the CSS.

    Coul’d there be a cache problem?

    I don’t know much about the WordPress cache, but maybe you are getting the page from your browser cache. Check with View source in your browser if the image reference is <src="kubrickheader.gif"> after you change it.

    Thread Starter miw

    (@miw)

    I think i disabled the cache because i had installation problems – maybe that has something to do with it? after logging in i had alwas a blank screen so i defined something about the cache in the login file. (i forgot what it was – i could look it up though)

    the source from the header according to my browser:


    <style type="text/css" media="screen">

    /* To accomodate differing install paths of WordPress, images are referred only here,

    and not in the wp-layout.css file. If you prefer to use only CSS for colors and what

    not, then go right ahead and delete the following lines, and the image files. */

    body { background: url("https://localhost/wordpress/wp-content/themes/default/images/kubrickbgcolor.jpg"); }

    #page { background: url("https://localhost/wordpress/wp-content/themes/default/images/kubrickbg.jpg") repeat-y top; border: none; }

    #header { background: url("https://localhost/wordpress/wp-content/themes/default/images/kubrickheader.gif") no-repeat bottom center; }

    #footer { background: url("https://localhost/wordpress/wp-content/themes/default/images/kubrickfooter.jpg") no-repeat bottom; border: none;}

    /* Because the template is slightly different, size-wise, with images, this needs to be set here

    If you don't want to use the template's images, you can also delete the following two lines. */

    #header { margin: 0 !important; margin: 0 0 0 1px; padding: 1px; height: 198px; width: 758px; }

    #headerimg { margin: 7px 9px 0; height: 192px; width: 740px; }

    /* To ease the insertion of a personal header image, I have done it in such a way,

    that you simply drop in an image called 'personalheader.jpg' into your /images/

    directory. Dimensions should be at least 760px x 200px. Anything above that will

    get cropped off of the image. */

    /*

    #headerimg { background: url('https://localhost/wordpress/wp-content/themes/default/images/personalheader.jpg') no-repeat top;}

    */

    it definitly displays kubrickheader.jpg though – when i delet kubrickheader from the images folder, it displays nothing at all..
    + i checked by clearing internetfiles/cookies/etc in iexplore, and it doenst really help..

    i don’t know where else i should change kubrickheader.jpg to the gif one?

    Try un-commenting this out:


    /*

    #headerimg { background: url('https://localhost/wordpress/wp-content/themes/default/images/personalheader.jpg&#39;) no-repeat top;}

    */

    And replace the path of the image to your own image ..

    Thread Starter miw

    (@miw)

    it displays the image correctly, but it still displays kubrickheader.jpg – so it’s quite useless for my transparent effect ??

    also if i erase this line:
    #header { background: url(“https://localhost/wordpress/wp-content/themes/default/images/kubrickheader.gif&#8221;) no-repeat bottom center; }

    it doesn’t make any difference at all.. still displaying the jpg file. is there any other reference in another css file perhaps?

    thanks anyway.. it’s nice of you to help!

    Its very hard to help without actually seeing what is happening ..

    maybe you could post the source of the page here:

    https://pastebin.com

    And that might help ..

    Thread Starter miw

    (@miw)

    yeah, i know it’s quite hard.. sorry i can’t make you access my machine/the code

    i posted the html it generates here:
    https://pastebin.com/504112

    the code of header.php is here:
    https://pastebin.com/504113

    here’s a jpg of the result.
    https://www.flickr.com/photo_zoom.gne?id=86086469&size=o

    i don’t get it.. – there’s no reference to the kubrickheader.jpg and still it’s displayed ??

    Clear your cache ..

    Try taking out this entire part in your header.php file:


    <style type="text/css" media="screen">
    ...
    ..
    ...
    ..
    #
    </style>

    What does that do?

    Thread Starter miw

    (@miw)

    how can i be certain i clear my cache with firefox? i thought i did that several times already.

    i did what you suggested: the flower-background disappeared etc, only the kubrickheader.jpg file still displayed..

    To clear the cache:

    Go to “Tools”, “Options” and then under the “Privacy” tab, you can clear you cache.

    Also you might want to disable the cache in WP itself. There was a thread in the forum on how to disable the cache in the wp-settings.php file ..

    I am running out of ideas to give you without being able to look/work directly on it .. ??

    Thread Starter miw

    (@miw)

    i think i cleared my cache correctly then.. :s – thanks a lot for the help! if i get to put this code all online i can give you access to work on it i suppose.. (if you would like that, it’s by no means necassary)
    – ill try to disable the cache in the wp_setttings file..

    i think i can work around it if i know how to adjust the size of the main column?

    here’s the image of how it looks now: https://www.flickr.com/photo_zoom.gne?id=86099516&size=o

    as you can see at the top, there’s still some of the kubrickbg.png file – if could get it to display a little lower, and that personalheader.png stays on the same place, it would be ok visually. (i mean for my purposes – ofcourse this is just a fooling around design ;))- unfortunately i don’t know where i can adjust the size of that.. (my css skills aren’t that developed :))

    it’s not optimal how its coded then i presume, but it would work, and that’s the most important now.

    in any case: many thanks!

    OK its very hard for me to work on it without directly meddling with the code myself, small issues are fine but this seems to be a bit out there ..

    Anyway, feel free to contact me at this email address, and I can help out properly ..

    skullcoded (at) gmail (dot) com

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘use a gif file as header’ is closed to new replies.