You must be logged in to post Login


Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Thesis AdSense Code Error

No Tags
UserPost

2:09 pm
November 12, 2012


Eric – PersonalProfitability.com

Portland, OR

Member

posts 2120

Post edited 2:09 pm – November 12, 2012 by Eric – NarrowBridge.net


Hi all, I am using Thesis 1.8.5 to add a new AdSense block, and whenever I try to make it only show on single posts (not homepage), I get a syntax error. Any ideas?

Current code that works:

//Start In Text AdSense
function in_text_ads() {
?>

<div id='adsensefloat' style='float:right;'>
<script type="text/javascript"><!–
google_ad_client = "xxxxx";
/* Narrow Bridge In Text */
google_ad_slot = "6649271535";
google_ad_width = 250;
google_ad_height = 250;
//–>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<?php
}

 add_action('thesis_hook_before_post', 'in_text_ads');
//End In Text Adsense
 
Code with error:
 
//Start In Text AdSense
function in_text_ads() {

if (is_single( )) {
?>

<div id='adsensefloat' style='float:right;'>
<script type="text/javascript"><!–
google_ad_client = "xxxxx";
/* Narrow Bridge In Text */
google_ad_slot = "6649271535";
google_ad_width = 250;
google_ad_height = 250;
//–>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<?php
}
	
 add_action('thesis_hook_before_post', 'in_text_ads');
//End In Text Adsense
No Tags

About the Yakezie.com Forum

Forum Timezone: America/Los_Angeles

Forum Stats:

Groups: 2
Forums: 9
Topics: 6383
Posts: 84794

Membership:

There are 13651 Members
There have been 20 Guests

There are 9 Admins
There are 8 Moderators

Top Posters:

My Personal Finance Journey – 3159
Khaleef @ KNS Financial – 3149
Budgeting in the Fun Stuff – 3048
Sustainable PF – 2759
Miss T @ Prairie Eco-Thrifter – 2213
Eric – PersonalProfitability.com – 2120

Administrators: The College Investor (1935 Posts), Financial Samurai (1803 Posts), LaTisha @YoungFinances (1715 Posts), Forest Parks (1337 Posts), 20s Finances (1147 Posts), Money Reasons (697 Posts), Chris Johnson (78 Posts), Sydney at Untemplater (0 Posts), Suba (0 Posts)

Moderators: Suba @ Wealth Informatics (1876 Posts), sooverthis (1041 Posts), PK @ DQYDJ (361 Posts), jmichelsen (208 Posts), Ramona (13 Posts), JeremyNJohnson (4 Posts), Moderator (0 Posts), rackgeek (0 Posts)