Title: Hardcode ad spots into theme
Last modified: August 20, 2016

---

# Hardcode ad spots into theme

 *  [Meag](https://wordpress.org/support/users/meag/)
 * (@meag)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hardcode-ad-spots-into-theme/)
 * Hello,
    I am looking for a way to hardcode adspots into my theme useing the ad
   injection plugin and the “Alt Ad Spots”. I was thinking of something like this:
 *     ```
       <?php if (( function_exists('adinj_print_ad')) && (adinj_print_ad('ad_bottom_alt_1') =''){ ?>
       	<?php { adinj_print_ad('ad_bottom_alt_1'); } ?>
       <?php } else { ?>
       	<?php if ( function_exists('adinj_print_ad')) && (adinj_print_ad('ad_bottom_alt_2') =''){ ?>
       		<?php { adinj_print_ad('ad_bottom_alt_2'); } ?>
       	<?php } ?>
       <?php } ?>
       ```
   
 * I cant figure out how to check if the code was inserted into the “Alt Ad Code
   box” or if its empty.
    Maybe there is an easier way I didnt find?
 * Any help is appreciated.
    Regards Meags
 * [http://wordpress.org/extend/plugins/ad-injection/](http://wordpress.org/extend/plugins/ad-injection/)

The topic ‘Hardcode ad spots into theme’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ad-injection.svg)
 * [Ad Injection](https://wordpress.org/plugins/ad-injection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-injection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-injection/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-injection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-injection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-injection/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [Meag](https://wordpress.org/support/users/meag/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/hardcode-ad-spots-into-theme/)
 * Status: not resolved