Title: Theme Won&#8217;t Allow Adsense Javascript?
Last modified: August 19, 2016

---

# Theme Won’t Allow Adsense Javascript?

 *  [angryanarchist](https://wordpress.org/support/users/angryanarchist/)
 * (@angryanarchist)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theme-wont-allow-adsense-javascript/)
 * I have what I believe is a simple problem. I have a wordpress theme that easily
   allows you to post “sponsor banners” on the right side, but the problem arises
   due to the fact that it is set up to only allow me to enter a “Banner Image” 
   and a “Banner URL” instead of a simple HTML text field (which I need due to the
   fact AdSense is a Javascript code). It also allows for a banner ad at the bottom
   of every post and that DOES allow HTML. How would I change (in my theme options
   area) the 2 seperate fields for url and image to a simple one field for html 
   entry?
 * Heres is the “Sponsors.PHP” file:
 * <div class=”banner”>
    -  <?php
       $ban1 = get_option(‘yes_banner1’); $url1 = get_option(‘yes_url1’);?
      > ” rel=”bookmark” title=””><img src=”<?php echo ($ban1); ?>” alt=”” style
      =”vertical-align:bottom;” />
    -  <?php
       $ban2 = get_option(‘yes_banner2’); $url2 = get_option(‘yes_url2’);?
      > ” rel=”bookmark” title=””><img src=”<?php echo ($ban2); ?>” alt=”” style
      =”vertical-align:bottom;” />
    -  <?php
       $ban3 = get_option(‘yes_banner3’); $url3 = get_option(‘yes_url3’);?
      > ” rel=”bookmark” title=””><img src=”<?php echo ($ban3); ?>” alt=”” style
      =”vertical-align:bottom;” />
    -  <?php
       $ban4 = get_option(‘yes_banner4’); $url4 = get_option(‘yes_url4’);?
      > ” rel=”bookmark” title=””><img src=”<?php echo ($ban4); ?>” alt=”” style
      =”vertical-align:bottom;” />
 * </div>

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theme-wont-allow-adsense-javascript/#post-1352185)
 * Why not just use a Text widget?
 *  Thread Starter [angryanarchist](https://wordpress.org/support/users/angryanarchist/)
 * (@angryanarchist)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theme-wont-allow-adsense-javascript/#post-1352241)
 * What do you mean by that? (excuse my “noobness” lol) I have the four boxes waiting
   to be filled by ads, how would I replace that area with something else? What 
   IS a text widget I should ask first lol
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/theme-wont-allow-adsense-javascript/#post-1352243)
 * it would be easier to help if you could post the name of the theme and a link
   to your site.
 * generally, what stops you to replace the following code from your sponsor.php:
   `
   <a href="" rel="bookmark" title=""><img src="<?php echo ($ban1); ?>" alt="" style
   ="vertical-align:bottom;" /></a>`
 * with your adsense code (use your own adsense with a matching size):
 *     ```
       <script type="text/javascript"><!--
       google_ad_client = "pub-zzzzzzzzzzz";
       google_ad_slot = "zzzzzzzzzzz";
       google_ad_width = xxx;
       google_ad_height = xx;
       //-->
       </script>
       <script type="text/javascript"
       src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
       </script>
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Theme Won’t Allow Adsense Javascript?’ is closed to new replies.

## Tags

 * [field](https://wordpress.org/support/topic-tag/field/)
 * [sponsors](https://wordpress.org/support/topic-tag/sponsors/)

 * 3 replies
 * 3 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/theme-wont-allow-adsense-javascript/#post-1352243)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
