php code help for wp revenue sharing
I added this to my mu.functions.php file to associate the author with a particular channel in adsense using the "ad slot" number.
function adsense_sharing($author) {
if($author == 'admin')
return 'xxxxx';
elseif ($author == 'xxxx')
return 'xxxxx';
elseif ($author == 'xxx')
return 'xxxxx';
else
return 'xxxxx';
}
?>
with the "xxx" being the author name and google ad slot #
then.. I added this to my single.php
<div style="float:right;"><script type="text/javascript"><!--
google_ad_client = "pub-xxxxx";
/* Snurtl */
google_ad_slot = "<?php echo adsense_sharing(get_the_author());?>";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
ok.. so if i view the source it shows the ad code fine.. just like it's supposed to be..It's showing the correct ad slot # for the author.. but the ad doesn't show, just a blank space so I obviously am missing a space or comma or something. when I copy the code directly into the template from adsense obviously it works fine...
No my domain is not blacklisted or banned.
solved: funky quotes in "<?php echo adsense_sharing(get_the_author());?>";
-
newmoon -
Thanks
{{ DiscussionBoard.errors[2158071].message }} -