• Hello!
    Im currently running wp 1.5 and the classic theme. Now, in the header i wanna insert the following script;

    <?php
     
    if(!isset($_COOKIE[“din_kana”])) {
      echo ‘<img src=”images/new.jpg”>’;
      setcookie(“din_kana”, TRUE, time()+3600);
    } else {
      echo ‘<img src=”images/visited.jpg”>’;
    }
     
    ?>

    As you may understand, i want to show the users one image first time they enter, and then show’em another later. But all i get is:

    Parse error: parse error, unexpected T_IF in /customers/gosse.se/gosse.se/httpd.www/artikel/wp-content/themes/classic/header.php on line 29

    Can anybody help out please?

    Thanks
    mårten, sweden

Viewing 3 replies - 1 through 3 (of 3 total)
  • I am also getting this error :
    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/reclaimy/public_html/wp-content/themes/global/sidebar.php on line
    After I added a link to my sidebar. I deleted link and still nothing, can’t figure out what I did wrong.

    Try inserting your code after the php header string. Whats the address to your website? What file are you trying to insert the code in? In your index or header file?

    Oh, I actually just fixed mine-I was just missing a (
    Thx -Sarah

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Parse error @ header template when adding my own php-code!’ is closed to new replies.