Replacing title with image

While I was on hiatus from blogging, wordpress automatically upgraded.  What that means for me is that some of my changes to the parent theme was lost and now is a good time to make these changes to my child theme.

First thing I noticed was that the title of my blog reverted back to the standard text of my blog title.  To replace this standard text with my blog title image:

site title greenI have to create a header.php file in my child theme.

For php files, you can easily just put the code you want to overwrite the parent code with.  For simplicity, I just copied over the entire parent code for header.php.  Then I proceed to replace this:

<h1 id=”site-title”><span><a href=”<?php echo esc_url( home_url( ‘/’ ) ); ?>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></a></span></h1>

with this:

<h1 id=”site-title”><span><a href=”<?php echo get_option(‘home’); ?>/”><img src=”https://lh3.googleusercontent.com/-vu_aGb9QthI/UG4Tk10K6AI/AAAAAAAAC7c/4ZMyo167ess/w342-h90-no/site+title+green.png”/> </a></h1>

For the image source, I just added the link to where I have the image.  In my case, I posted my title image in my google+ photos and from there, I just copied the image link.

Leave a Reply