Page 1 of 8

Replacing Title/Header with an Image?

PostPosted: Wed Feb 18, 2009 11:03 pm
by Astrakan
Does anyone have any experience with replacing the top blog title/header text with an image?

Is it perhaps as simple as just using an HTML img tag?

KM

Re: Replacing Title/Header with an Image?

PostPosted: Wed Feb 18, 2009 11:29 pm
by h0serdude
It's exactly that easy. Here's what I did in the header.php file (notice I commented out part of it):

Code: Select all
<div id="welcomeheading">
<h1><a href="<?php bloginfo('url'); ?>/">
   <img src="/images/banner.png">
<!--<?php    $replacethese = array('[',']');
      $replacewith = array('<span id="middleword">','</span>');
      echo str_replace($replacethese, $replacewith, get_bloginfo('title')); ?>-->
      </a></h1>
</div>

Re: Replacing Title/Header with an Image?

PostPosted: Wed Feb 18, 2009 11:31 pm
by Astrakan
Cool beans. Thanks.

Re: Replacing Title/Header with an Image?

PostPosted: Sat Jul 11, 2009 1:13 am
by kckal
I tested out this tip to put the image source in the header. instead of my image, it shows a thin vertical line. please help.

Re: Replacing Title/Header with an Image?

PostPosted: Sat Jul 11, 2009 8:48 pm
by kckal
ok so i think i understand a bit better. evidently regardless of the file that specifies the header image (css or header.php), there needs to be an area defined for the php to nest: since i needed the whole image to be clickable, i added another class in the css, defined the style and img, and it worked!

regards
kc

Re: Replacing Title/Header with an Image?

PostPosted: Sat Jul 11, 2009 10:30 pm
by wayne
Good work.
The original theme had exactly that, but I changed it to a text header to make it more customisable.
You can delete entirely the bit in comments.

Re: Replacing Title/Header with an Image?

PostPosted: Sun Jul 12, 2009 11:34 am
by exigo
For best SEO practice, I've kept the text in the header, but put in a background image behind it.

Site at: www.hereisthenews.co.uk

Style sheet at: http://www.hereisthenews.co.uk/wp-conte ... /style.css

Hope this helps.

Re: Replacing Title/Header with an Image?

PostPosted: Tue Jul 21, 2009 1:25 am
by vqlive
kckal wrote:ok so i think i understand a bit better. evidently regardless of the file that specifies the header image (css or header.php), there needs to be an area defined for the php to nest: since i needed the whole image to be clickable, i added another class in the css, defined the style and img, and it worked!

regards
kc


kckal, could you please specify how you defined the area (within the style sheet or the header.php) and the code you used? I'm having the same issue with the thin vertical line and am a newbie. Thank you in advance.

vqlive

Re: Replacing Title/Header with an Image?

PostPosted: Mon Oct 19, 2009 1:49 am
by kckal
wayne,
thanks for the reply and the great theme.

vqlive,
i did not come back to this forum as soon as i fixed my problem and shared it (i thought), i apologize.

anyone,
if the question has not been answered, here is mine as brief as i can make it.

i added my needs to the style sheet:
Code: Select all
#welcomeheading h1 a {
   width: 940px;
   height: 40px;
   display: block;
   background: url(img/HeaderImage.png) no-repeat top center;


there is already an existing div in header.php, so i used it (welcomeheading).

regards,
kc

Re: Replacing Title/Header with an Image?

PostPosted: Sun Nov 01, 2009 7:18 am
by sawa
I followed h0serdude's directions, and I'm getting the thin vertical line also rather than my logo. Any help would be great.