Posts Tagged ‘google adsense’

制作了一个Google Adsense插件,copy from e-xia.com

08.28.2009 by star - 0 Comment
Posted in BLOG

昨天成功申请了Google Adsense帐户,网上找了一下相关的wordpress插件,根据轶侠的文章做了一个简单插件,据说要30年才能达到Google $100的标准 O(∩_∩)O~

原文在这里:给WP加上Google广告代码

<?php
add_filter('the_content', 'google_ads');
function google_ads($content){
  if(is_page()||is_single()){
    ob_start();
?>
<div class="google center">
<!--Google AdSense Code HERE-->
</div>
<?php
    $content = ob_get_contents().$content;
    ob_end_clean();
  }
  return $content;
}
?>