WordPress.org

Forums

[resolved] How to add an extra image to the header (3 posts)

  1. unoengborg
    Member
    Posted 1 year ago #

    I'm trying to modify the twentythirteen theme. What I want to do is to add an extra image just before the blog name.

    I try to modify header.php by replacing
    <h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>

    with:

    <h1 class="site-title"><img src="images/myextraimage.jpg"/><?php bloginfo( 'name' ); ?></h1>

    But somehow it seams that I get the wrong path to the image.
    So what path should I user?

  2. sdavis2702
    Member
    Posted 1 year ago #

    Upload the image to your media library. Once it's uploaded, go to its edit page. The "File URL" will display for you. Use that.

  3. unoengborg
    Member
    Posted 1 year ago #

    Thanks, but that would make the image part of the data rather than the theme.

    I managed to solve it by using:

    <h1 class="site-title"><img src="<?php bloginfo('home');?>/wp-content/themes/twentythirteen-child-01/images/myextraimage.jpg"/><?php bloginfo( 'name' ); ?></h1>

Topic Closed

This topic has been closed to new replies.

About this Topic