• I have just gotten my blog up and running and I keep getting this message:

    Parse error: syntax error, unexpected ”’ (T_ENCAPSED_AND_WHITESPACE) in /home/margarethellstrom/margoseekingmeaning.com/wp-content/themes/time-less/header.php on line 1012

    I have tried to restore that section of the theme from the original version, as well as tried to correct it myself numerous times to no avail. Here are the last 30 lines or so of the code (line 1012 is the last one). Someone please help!!

    if (is_single() || is_page()) {
    $vbegy_header_adv_type = rwmb_meta(‘vbegy_header_adv_type’,’radio’,$post->ID);
    $vbegy_header_adv_code = rwmb_meta(‘vbegy_header_adv_code’,’textarea’,$post->ID);
    $vbegy_header_adv_href = rwmb_meta(‘vbegy_header_adv_href’,’text’,$post->ID);
    $vbegy_header_adv_img = rwmb_meta(‘vbegy_header_adv_img’,’upload’,$post->ID);
    }

    if ((is_single() || is_page()) && (($vbegy_header_adv_type == “display_code” && $vbegy_header_adv_code != “”) || ($vbegy_header_adv_type == “custom_image” && $vbegy_header_adv_img != “”))) {
    $header_adv_type = $vbegy_header_adv_type;
    $header_adv_code = $vbegy_header_adv_code;
    $header_adv_href = $vbegy_header_adv_href;
    $header_adv_img = $vbegy_header_adv_img;
    }else {
    $header_adv_type = vpanel_options(“header_adv_type”);
    $header_adv_code = vpanel_options(“header_adv_code”);
    $header_adv_href = vpanel_options(“header_adv_href”);
    $header_adv_img = vpanel_options(“header_adv_img”);
    }
    if (($header_adv_type == “display_code” && $header_adv_code != “”) || ($header_adv_type == “custom_image” && $header_adv_img != “”)) {
    echo ‘<div class=”clearfix”></div>
    <div class=”advertising”>’;
    if ($header_adv_type == “display_code”) {
    echo stripcslashes($header_adv_code);
    }else
    if ($header_adv_href != “”)
    echo ‘‘;
    }
    echo ‘<img alt=”” src=”‘.$header_adc_img.'”>’; if ($header_adv_href !='”) echo ‘<a’

Viewing 5 replies - 1 through 5 (of 5 total)
  • can you paste here this line number: header.php on line 1012

    Hello margarethellstrom,

    I think you made mistake in the last line(if ($header_adv_href !='”) echo ‘<a’)
    You should put double quote instead of single quote
    if ($header_adv_href !=””)

    Hope it helps

    Thread Starter margarethellstrom

    (@margarethellstrom)

    I tried to use a double quote and I got this message.

    Parse error: syntax error, unexpected end of file, expecting ‘,’ or ‘;’ in /home/margarethellstrom/margoseekingmeaning.com/wp-content/themes/time-less/header.php on line 1013

    Here is line 1012 which is the last line:

    echo ‘<img alt=”” src=”‘.$header_adc_img.'”>’; if ($header_adv_href !=””) echo ‘<a’

    Thread Starter margarethellstrom

    (@margarethellstrom)

    I added a ; and I am now just getting a message that says unexpected end of file. What is the proper way to end this file?

    You have missed the semicolon at the end of line.
    if ($header_adv_href !=””) echo ‘<a’;

    I have tested this piece of code in my local server.
    Hope it helps

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘php parse syntax error’ is closed to new replies.