unable to put adsense in customfunctions.php

oblivion19

Senior Member
Joined
Aug 24, 2009
Messages
916
Reaction score
435
Hey all,

Would appreciate some help here. I have no knowledge or experience in coding.

I am trying to put my ad-sense code in functions.php file so it could show up below my title in each post.

The theme im using is thesis 1.6

I googled and saw how to do it on various blogs. However, whenever, im copy pasting the code at the end of document and saving it, the website wont work and give error along the lines of some kind of parsing error at line...

I dont really know what im doing wrong.Im copy pasting the exact stuff!

I am doing this in my cpanel....
 
Last edited:
You will need to escape either the single or double quotes within your Adsense code (depending on whether you are using a single or double quote around your variables in your function) with a backslash eg.

Code:
$var = "<script=\"script_name.js\">";

or maybe

$var = '<script=\'script_name.js\'>';

Post the function you're trying to use to display your Adsense plus the precise error messages for more feedback. You have to be specific when you ask coding questions.
 
if you are putting it inside of a php function, you'll need to echo the entire script code.

echo "<script= this is all of the code and any " need to have a \ before it, so \" would be proper and then at the end of the code just close it with a ";

This will echo the JavaScript code inside of the html and adsense will show.
 
Show us example of modified php file that You made, then we'll can help You.
 
uncguy4321 helped me out over skype and fixed the prob.. tx a lot dude..
 
Back
Top