WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Graphene theme] header.php coding - HELP (8 posts)

  1. Outright_Rugby
    Member
    Posted 1 year ago #

    Hello,

    I was adjusting the header.php in my theme editor.
    The piece of code I was adjusting looks like this:

    <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>';
    				$header_img_tag .= $header_img;
    				$header_img_tag .= '</a>';
    
    				$header_img = $header_img_tag;
    			}
    			echo $header_img;
    		?>

    However, I get the following ERROR message when trying to visit my site:

    Parse error: syntax error, unexpected T_STRING in \\CPT.WA\WEBS\Data01\Spaces\KEV40\outrightrugby.com\wwwroot\wp-content\themes\graphene\header.php on line 65

    Can anyone please help me to make the small adjustment that I am missing.

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

    Thank you.

  2. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Can you post the contents of line 65 header.php?

  3. Outright_Rugby
    Member
    Posted 1 year ago #

    What tool can I use to find the exact line #65? Sorry!

  4. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Try Pastebin (submit your code once pasted).

  5. Outright_Rugby
    Member
    Posted 1 year ago #

    This is line #65:

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

    Thank you!

  6. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 1 year ago #

    Replace that line with

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

    Worked, thank you so much :)

  8. Outright_Rugby
    Member
    Posted 1 year ago #

    Now for some reason, I get the following message if I try and visit the site, and my custom header image does not display:

    http://www.outrightrugby.com/wp-content/themes/graphene/images/headers/flow.jpg alt='' class='header-img' />

    it displays at the top of my site and the header image is not there. Do I need to insert the location of the header image into line 65?

    http://www.outrightrugby.com

    Thank you :)

Topic Closed

This topic has been closed to new replies.

About this Topic