WordPress.org

Ready to get started?Download WordPress

Forums

Picture over the header? (16 posts)

  1. HenrikL
    Member
    Posted 8 years ago #

    I want to place a picture over the header-picture.
    I placed the picture in my image folder in the theme-map (wordpress\wp-content\themes\mytheme\images).
    I write following code: <img src="/images/thepicture.jpg" width="758" height="98" style="float: left" />
    in header.php in the beginning of the <body>.
    It seems to be the right place to write it but the picture still won't show up. I think my link may be wrong, but I can't figure out where else to put it.
    anyone got a suggestion?

    thanks very much...

  2. petit
    Member
    Posted 8 years ago #

    Your path to the image img src="/images/thepicture.jpg" suggests that your image resides in the images directory directly under the document root. The starting '/' points to the root directory.

    You can use the full path /wordpress/wp-content/themes/mytheme/images/thepicture.jpgif you like.

    I would rather create a directory wordpress/images and sav the image there, which would make the path
    /wordpress/images/thepicture.jpg

    It is shorter and the path to the image is the same even if you decide to change your theme.

  3. HenrikL
    Member
    Posted 8 years ago #

    cheers thanks alot :)

  4. HenrikL
    Member
    Posted 8 years ago #

    Hm. I am not that bad in html but I can't get this to work. I am writing regular code and have put the image in the right folder. Still it won't show up.

    Is this something special and particular I have to do because it is wordpress?

    thx..

  5. ladydelaluna
    Member
    Posted 8 years ago #

    can we have a link to the site so maybe we can see what's going on?

  6. HenrikL
    Member
    Posted 8 years ago #

    Im afraid not, Im running it locally at my computer at the moment :(

    But this is the image adress now:
    <img src="wordpress/wp-content/themes/GG/images/a.jpg" width="960" height="98" style="float: left" />

    For the other pictures, for example the header is the adress:
    #header { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/personalheader.jpg") no-repeat bottom center; }

    And that works fine.. Can't figure out how to solve this one :(

  7. ladydelaluna
    Member
    Posted 8 years ago #

    try using the absolute complete URL of the image file... see if that works?

  8. HenrikL
    Member
    Posted 8 years ago #

    no it did not work. this is so weird. maybe wordpress can't handle "own pictures"..?
    maybe I have to do something special?

  9. Chris_K
    Member
    Posted 8 years ago #

    No, wordpress handles 'em just fine. It is just html.

    But without being able to look at the source and style sheet it sure is difficult to help fix!

    Maybe put the header.php from your theme and stylesheet up at a pastebin and give us links so we can see the source?

  10. petit
    Member
    Posted 8 years ago #

    The pastebin is here http://pastebin.com/.

    You can post the link you get here.

  11. HenrikL
    Member
    Posted 8 years ago #

    ok,

    http://www.gorillagang.com/header.txt
    http://www.gorillagang.com/style.txt

    There they are. I put the code in txt-files but you have to pic show->source for the header. :)

    thanks again for your help..!

  12. HenrikL
    Member
    Posted 8 years ago #

    it didn't say much, did it?

  13. Chris_K
    Member
    Posted 8 years ago #

    Nothing jumped out at me, alas.

  14. Bodhipaksa
    Member
    Posted 8 years ago #

    Did you try following ladydelaluna's advice? Viz:

    "try using the absolute complete URL of the image file... see if that works?"

    That would mean including the full URL for the image, starting with "http://www.yourdomain.com/etc/etc".

  15. petit
    Member
    Posted 8 years ago #

    It,s a little bit hard to imagine from your style.txt and header.txt, how it all is meant to work.
    I see some strange behavior though.
    In your header.php ( as it were ) you have this markup:
    <img src="wordpress/wp-content/themes/GG/images/a.jpg" width="960" height="98" style="float: left" />

    I guess you mean that this is the full (relative ) path to your image. It is not. The full relative path has to start at the document root of your web site, i.e. at "/".
    The markup should look like this:
    <img src="/wordpress/wp-content/themes/GG/images/a.jpg" width="960" height="98" style="float: left" />

    The image is linked in outside the "page", "header" and "headerimg" containers ( <div> )
    This means it has a good chance of being displaced with respect to the rest of the page. The "page" <div> is the wrapper that contains everyting else on the page.
    I suppose in your header.txt you have deleted the original header image markup.
    -------------
    When you say you want to place the image "over the header -picture", do you mean it should be vertically above the the header image or on top ( hiding part of the header image ).

  16. HenrikL
    Member
    Posted 8 years ago #

    Ive tried the complete url. Ive tried:
    <img src="/wordpress/wp-content/themes/GG/images/a.jpg" width="960" height="98" style="float: left" />

    I want the image placed above the header image(not on top hiding part of the header image). I have not deleted the original header image markup.

    The image is linked outside the <div>s because that was the only way I could figure out how to get the picture over the headerimage.

    I also did a test: I uploaded an image in a post and looked at that ones link. It was:
    http://localhost/wordpress-21.0.2/wordpress/wp-content/uploads/2006/03/gang1.thumbnail.jpg

    Then I put the a.jpg in the same folder and linked it exactly the same way (in 2 ways):
    http://localhost/wordpress-21.0.2/wordpress/wp-content/uploads/2006/03/a.jpg

    and
    /wordpress/wp-content/uploads/2006/03/a.jpg

    Still it did not work. Im really confused..

Topic Closed

This topic has been closed to new replies.

About this Topic