• Resolved Outright_Rugby

    (@outright_rugby)


    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Outright_Rugby

    (@outright_rugby)

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

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    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?

    Thread Starter Outright_Rugby

    (@outright_rugby)

    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!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    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' />";

    Thread Starter Outright_Rugby

    (@outright_rugby)

    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! 🙂

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try changing this

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

    to

    if ( ! is_front_page() )

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Graphene theme] Header image not displaying – HELP’ is closed to new replies.