Replacing Title/Header with an Image?

Any questions about styling and customising the layout, changing the number of columns, changing the number of sliding images and so on.

Replacing Title/Header with an Image?

Postby Astrakan » Wed Feb 18, 2009 11:03 pm

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
Astrakan
I'm new here
 
Posts: 2
Joined: Wed Feb 18, 2009 11:00 pm

Re: Replacing Title/Header with an Image?

Postby h0serdude » Wed Feb 18, 2009 11:29 pm

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>
h0serdude
I'm new here
 
Posts: 1
Joined: Wed Feb 18, 2009 9:44 pm

Re: Replacing Title/Header with an Image?

Postby Astrakan » Wed Feb 18, 2009 11:31 pm

Cool beans. Thanks.
Astrakan
I'm new here
 
Posts: 2
Joined: Wed Feb 18, 2009 11:00 pm

Re: Replacing Title/Header with an Image?

Postby kckal » Sat Jul 11, 2009 1:13 am

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.
kckal
I'm a regular
 
Posts: 7
Joined: Sun Sep 21, 2008 1:29 am

Re: Replacing Title/Header with an Image?

Postby kckal » Sat Jul 11, 2009 8:48 pm

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
I'm a regular
 
Posts: 7
Joined: Sun Sep 21, 2008 1:29 am

Re: Replacing Title/Header with an Image?

Postby wayne » Sat Jul 11, 2009 10:30 pm

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.
wayne
Site Admin
 
Posts: 726
Joined: Tue Apr 08, 2008 7:02 pm

Re: Replacing Title/Header with an Image?

Postby exigo » Sun Jul 12, 2009 11:34 am

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.
exigo
Legend!
 
Posts: 14
Joined: Sat Jul 04, 2009 11:57 am

Re: Replacing Title/Header with an Image?

Postby vqlive » Tue Jul 21, 2009 1:25 am

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
vqlive
I'm new here
 
Posts: 1
Joined: Fri Jul 17, 2009 2:54 pm

Re: Replacing Title/Header with an Image?

Postby kckal » Mon Oct 19, 2009 1:49 am

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
kckal
I'm a regular
 
Posts: 7
Joined: Sun Sep 21, 2008 1:29 am

Re: Replacing Title/Header with an Image?

Postby sawa » Sun Nov 01, 2009 7:18 am

I followed h0serdude's directions, and I'm getting the thin vertical line also rather than my logo. Any help would be great.
sawa
I'm new here
 
Posts: 2
Joined: Sun Nov 01, 2009 12:17 am

Next

Return to Advanced - Customising the theme