Adding DFP Script to Wordpress
I am playing with Wordpress 3 for the first time and had a quick question.
I am placing ads on a site and wondered the best practice to add in the script. The code that Google generates is in 2 parts, one for the of the page and one where the ad should go
The head code is in the form
<script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'>
</script>
<script type='text/javascript'>
GS_googleAddAdSenseService("ca-pub-123123");
GS_googleEnableAllServices();
</script>
<script type='text/javascript'>
GA_googleAddSlot("ca-pub-123123", "300x250_Ad");
</script>
<script type='text/javascript'>
GA_googleFetchAds();
</script>
Then the code for the ad is:
<!-- ca-pub-123123/300x250_Ad -->
<script type='text/javascript'>
GA_googleFillSlot("300x250_A");
</script>
I downloaded a plugin Advertising Manager that allows me to add ads into the page but only seems to allow putting in one block of code. I can add all the code joined up but if I want to add other ad positions later it is not the best...
I can't go into my Theme and add the code in there, as I am using Multiple Sites the code will need t开发者_如何学Pythono difer from site to site, is there something very simple I am missing to add stuff into the and then I can use Advertising Manager to display the individual ad code...
Try using the the AdSense-Deluxe WordPress Plugin
It would appear the plugin has a bug, the shortcode you're using is calling a function which is directly outputting the code for DFP (which is called when wordpress is preparing the page content, hence it appearing all at once at the top) instead of returning it to be inserted throughout the content.
精彩评论