WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Graphene theme] Header image not displaying - HELP (7 posts)

  1. Outright_Rugby
    Member
    Posted 1 year ago #

    I get the following line of code appearing on my site when I visit it:
    http://www.outrightrugby.com/wp-content/uploads/2012/09/Outright-Rugby-Header-8.jpgalt='' class='header-img' />

    and my custom header image does not display.
    Does anyone know what this could be resulting from and how I can fix it?

    Help would be much appreciated, thank you.

  2. Outright_Rugby
    Member
    Posted 1 year ago #

    The code appears at the top, and the url is: http://www.outrightrugby.com - to see for yourself, thank you!

  3. Andrew
    Forum Moderator
    Posted 1 year ago #

    It just looks like you're missing the start of your HTML <img> element.
    http://www.w3schools.com/tags/tag_img.asp

    Were you editing header.php?

  4. Outright_Rugby
    Member
    Posted 1 year ago #

    Hi Andrew, thank you.

    Yes I was editing header.php
    It's actually the same line #65 that you helped with yesterday. The code is as follows:

    <div id="header">
    
            <?php
    			$header_img = $header_img. "alt='' class='header-img' />";
    			if ( ! is_front_page() && $graphene_settings['link_header_img'] ) {
    				$header_img_tag = '<a href=""' . apply_filters( 'graphene_header_link' , home_url() ) . '" id="header_img_link" title="' . esc_attr__( 'Go back to the front page', 'graphene' ) . '">';
    				$header_img_tag .= $header_img;
    				$header_img_tag .= '</a>';
    				$header_img = $header_img_tag;
    			}
    			echo $header_img;
    		?>

    Could you point me to where I'm going wrong?
    Thanks so much!

  5. Andrew
    Forum Moderator
    Posted 1 year ago #

    This

    $header_img = $header_img. "alt='' class='header-img' />";

    Represents this

    http://www.outrightrugby.com/wp-content/uploads/2012/09/Outright-Rugby-Header-8.jpgalt='' class='header-img' />

    Try using

    $header_img = "<img src='.$header_img.' alt='' class='header-img' />";
  6. Outright_Rugby
    Member
    Posted 1 year ago #

    Thanks Andrew, I had to insert the image url into the src field even though the theme has custom header image upload options, which I was using before. No problem tho, glad it's working now thanks.

    I want to make the header image clickable to return to the homepage, any idea where I can make this happen?

    Thanks! :)

  7. Andrew
    Forum Moderator
    Posted 1 year ago #

    Try changing this

    if ( ! is_front_page() && $graphene_settings['link_header_img'] )

    to

    if ( ! is_front_page() )

Topic Closed

This topic has been closed to new replies.

About this Topic