Support » Plugins and Hacks » [Plugin: Google Adsense for Feeds] Code Problem

  • Max


    $publisher is outside the scope of the function adsense_for_feeds, and should therfore be declared as global.


    $publisher = 'ca-pub-XXXXXXX';
    add_filter('the_content', 'adsense_for_feeds');
    function adsense_for_feeds( $content ) {
    	global $post, $id;
    	$blog_key = substr( md5( get_bloginfo('url') ), 0, 16 );
    	if ( ! is_feed() ) return $content;

    the line global $port, $id; should be changed to global $id, $post, $publisher

  • The topic ‘[Plugin: Google Adsense for Feeds] Code Problem’ is closed to new replies.