Title: [Plugin: Google Adsense for Feeds] Code Problem
Last modified: August 19, 2016

---

# [Plugin: Google Adsense for Feeds] Code Problem

 *  [Max](https://wordpress.org/support/users/clementsm/)
 * (@clementsm)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/plugin-google-adsense-for-feeds-code-problem/)
 * $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/](http://wordpress.org/extend/plugins/adsense-for-feeds/)

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

 * 0 replies
 * 1 participant
 * Last reply from: [Max](https://wordpress.org/support/users/clementsm/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/plugin-google-adsense-for-feeds-code-problem/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
