• Resolved deanwenick

    (@deanwenick)


    Hi –
    actually, not 2010, this is a child theme. I want to replace my website Title in the header with a .png image. How can I do that?

    Thanks,
    Dean

Viewing 8 replies - 1 through 8 (of 8 total)
  • You’d need to edit your child theme’s header.php template file.

    Thread Starter deanwenick

    (@deanwenick)

    I found this in the header.php

    <<?php echo $heading_tag; ?> id=”site-title”>
    <span>
    ” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?>
    </span>
    </<?php echo $heading_tag; ?>>

    I tried putting a ling to my .png in various places, but I just don’t know how to edit the php

    Is it even possible to put an image in place of the theme title here?

    Thank you.

    Try changing:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    <<?php echo $heading_tag; ?> id="site-title">
    	<span>
    		<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    	</span>
    </<?php echo $heading_tag; ?>>

    to:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    <<?php echo $heading_tag; ?> id="site-title"><span><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo get_stylesheet_directory_uri();?>/images/logo.jpg" width="xx" height="yy" alt="" /></a></span></<?php echo $heading_tag; ?>>

    This code assumes that your image is called logo.jpg and is in your theme’s images sub-folder.

    Thread Starter deanwenick

    (@deanwenick)

    Thanks Esmi, that almost works. I get the broken image link symbol between two lines and /a>

    I’ll come back to it later, I’m sure I’m missing something. Would you like me to mark this resolved?

    Only if you feel that it is resolved. If you could post a link to your site with the missing header image, we might be able to sort out this last issue.

    Thread Starter deanwenick

    (@deanwenick)

    If you are up to it – Thanks. I really appreciate the help.

    my site is:
    http://wenick-photo.com/wp/

    Here is code from my header.php:

    <div id="masthead">
    			<div id="branding" role="banner">
    				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    <<?php echo $heading_tag; ?> id="site-title"><span><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo get_stylesheet_directory_uri();?>images/logo.png" width="180" height="30" alt="" />/a></span></<?php echo $heading_tag; ?>>
    				<div id="site-description"><?php bloginfo( 'description' ); ?></div>

    my file logo.png is a png in the images folder of my theme.

    This is essentially the twentyten theme

    1. There were two typos in my original replacement code – sorry. Try using:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    <<?php echo $heading_tag; ?> id="site-title"><span><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo get_stylesheet_directory_uri();?>/images/logo.jpg" width="xx" height="yy" alt="" /></a></span></<?php echo $heading_tag; ?>>
    Thread Starter deanwenick

    (@deanwenick)

    Perfect! Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘adding image to header in 2010’ is closed to new replies.