WordPress.org

Ready to get started?Download WordPress

Forums

adding logo to header (10 posts)

  1. dmehling
    Member
    Posted 4 years ago #

    I am trying to add a logo to the header of my blog next to the blog title. I think the link to the logo image file belongs somewhere in this line of code but I'm not exactly sure where or how to add it:

    <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a> <?php bloginfo('description'); ?></h1>

  2. Rafael Sirotheau
    Member
    Posted 4 years ago #

    change the above code to:

    <a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_url') ?>/YOUR-THEME-IMG-FOLDER/IMAGE-FILE.jpg" alt="<?php bloginfo('description'); ?>" title="<?php bloginfo('name'); ?>" /></a>

  3. dmehling
    Member
    Posted 4 years ago #

    I'm not sure that's correct because now that I changed it according to what you said, the title has disappeared in addition to no logo appearing. This is what the updated code looks like:

    <h1><a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_url') ?>http://bionicpreacher.com/theme_content/bionic_icon_white.png" alt="<?php bloginfo('description'); ?>" title="<?php bloginfo('name'); ?>" /></a><?php bloginfo('description'); ?></h1>

  4. Rafael Sirotheau
    Member
    Posted 4 years ago #

    with this code, I supposed that you would put your logo inside the theme's image folder. This way, the url to image would be:

    http://bionicpreacher.com/wp-content/themes/YOUR_THEME_FOLDER/YOUR-THEME-IMG-FOLDER/IMAGE-FILE.jpg

    where:

    YOUR-THEME-IMG-FOLDER = probably something like 'images'
    IMAGE-FILE.jpg = bionic_icon_white.png

    instead, if the full path to image is:

    http://bionicpreacher.com/theme_content/bionic_icon_white.png

    the code should be:

    <h1><a href="<?php bloginfo('url'); ?>"><img src="http://bionicpreacher.com/theme_content/bionic_icon_white.png" alt="<?php bloginfo('description'); ?>" title="<?php bloginfo('name'); ?>" /></a><?php bloginfo('description'); ?></h1>
  5. dmehling
    Member
    Posted 4 years ago #

    Thanks again for your help. I entered the code exactly as you have written it and now I can see my logo. But now the title has disappeared. Take a look at my actual site if you get a chance:

  6. dmehling
    Member
    Posted 4 years ago #

  7. Rafael Sirotheau
    Member
    Posted 4 years ago #

    I thought you wanted to replace it...

    alright.. then do this:

    <h1><a href="<?php bloginfo('url'); ?>"><img src="http://bionicpreacher.com/theme_content/bionic_icon_white.png" alt="<?php bloginfo('description'); ?>" title="<?php bloginfo('name'); ?>" /> <?php bloginfo('name'); ?></a><?php bloginfo('description'); ?></h1>
  8. dmehling
    Member
    Posted 4 years ago #

    okay, one more thing. The way it is now, the text is lower than the logo. How do I balance their position so it looks right?

  9. Rafael Sirotheau
    Member
    Posted 4 years ago #

    how exactly would you like it to be?

  10. Rafael Sirotheau
    Member
    Posted 4 years ago #

    I think I've got it...

    try this:

    <h1><a href="<?php bloginfo('url'); ?>"><img src="http://bionicpreacher.com/theme_content/bionic_icon_white.png" alt="<?php bloginfo('description'); ?>" title="<?php bloginfo('name'); ?>" align="left" /> <?php bloginfo('name'); ?></a><?php bloginfo('description'); ?></h1>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags