Support » Themes and Templates » [Graphene theme] Header image not displaying – HELP

  • Resolved Outright_Rugby


    I get the following line of code appearing on my site when I visit it:'' 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)
  • The code appears at the top, and the url is: – to see for yourself, thank you!

    Moderator Andrew Nevins


    It just looks like you’re missing the start of your HTML <img> element.

    Were you editing header.php?

    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">
    			$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!

    Moderator Andrew Nevins



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

    Represents this'' class='header-img' />

    Try using

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

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

    Moderator Andrew Nevins


    Try changing this

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


    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.