WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Google Adsense for Feeds] Code Problem (1 post)

  1. Max
    Member
    Posted 4 years ago #

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

    ie.:

    $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

    http://wordpress.org/extend/plugins/adsense-for-feeds/

Topic Closed

This topic has been closed to new replies.

About this Topic