• I keep trying to update my functions.php file for my site so that I can post Adsense ads wherever I want them, following these directions.

    I’m adding the code for my Adsense ad to the end of the functions.php file, and it looks exactly like the screenshot on the page referenced above (other than the fact that I copy/pasted in my Adsense code where it says to), but when I click “update file”, I get this error,

    “Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/agtheman/public_html/get2theleague.com/wp-content/themes/silveray/functions.php on line 67”

    Is this because my theme is rejecting this functionality? Any help you can provide is appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • This is an error with the PHP. You have a problem with a quote that is out of place.

    Let me know if you cannot find it – I will try to help.
    tom

    Thread Starter agfreesafety

    (@agfreesafety)

    I’m having trouble figuring out where the quote problem is in the php. If you could please help me identify it, it would be appreciated. Thanks for your time.

    Drop a copy of the file into the WordPress pastebin and post the pastebin url here. Perhaps someone will be able to spot the problem and suggest a solution.

    Thread Starter agfreesafety

    (@agfreesafety)

    I get the error when I try to log into the WordPress Admin portal. And I don’t have access to FTP right now where I can access the Function.php file directly.

    If you can’t help without that, I’ll have to wait until I’m at a machine that I can FTP from so I can display the code in this thread. Thanks.

    Thread Starter agfreesafety

    (@agfreesafety)

    Your error is on the last line:

    add_shortcode(showmyads', 'adsenseads');

    should be:

    add_shortcode('showmyads', 'adsenseads');

    (You’re missing a single quote mark just before “showmyads”).

    cm

    Thread Starter agfreesafety

    (@agfreesafety)

    Hello again. This was working up until recently. For some reason, my ads have disappeared, leaving just a blank spot where the ads were showing up.

    If you’d like to view an example of what I’m talking about, on this page, the ad is supposed to show up under the first video in the post, right beneath where it says “there’s a lot of different…”

    As you can see, there’s only open space showing up where the ad once was. I looked in my function.php file, and the code is correct. I went into Adsense, and the code for the ad unit I had selected to be placed here is still the same. This ad unit still shows up as “Active” from within Adsense.

    Any idea what could be going on, here? Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error With Functions.php file’ is closed to new replies.