Title: Manual insertion: Shortcode or PHP function call not working
Last modified: November 15, 2017

---

# Manual insertion: Shortcode or PHP function call not working

 *  Resolved [nikkoboy](https://wordpress.org/support/users/nikkoboy/)
 * (@nikkoboy)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/)
 * Hi,
 * First of all I wish to congratulate you for the fantastic plugin you created.
   I’ve been using it for more than three years now, and i’m really happy with all
   its features.
 * I’m contacting today you because I don’t seem to be able to use your plugin’s
   shortcode feature or PHP function call (manual insertion) with my theme’s ad 
   space. This ad space accepts html, and I’m able to use any kind of adcode ranging
   from Adsense to simple image html. however, Ad Inserter’s shortcode just features
   a shortcode in the header ad code space when the page has loaded, and the PHP
   function does not display anything.
 * I read all your documentations, but nothing works. Here is an example of a webpage
   where I’m trying to implement your shortcode (the ad space is in the header, 
   on the right hand side opposite to the logo): [https://www.fleamarketinsiders.com/brick-lane-market/](https://www.fleamarketinsiders.com/brick-lane-market/)
 * I also tried a workaround, by using “custom hooks”, since Ad Inserter offers 
   this solution: [https://adinserter.pro/documentation#custom-hooks](https://adinserter.pro/documentation#custom-hooks)
 * I read the documentation in the above link, and I looked for the name that is
   used in the do_action () WordPress function of my theme, but I think I did not
   properly identify it. Is it “header-ad”? I tried this action as a custom hook,
   but it did not work. The ad does not appear either.
 * I’d really appreciated any guidance you could provide, so I can use the ad space
   in the header (right hand side opposite to the logo) with Ad Inserter.
 * Thanks!
    -  This topic was modified 8 years, 5 months ago by [nikkoboy](https://wordpress.org/support/users/nikkoboy/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmanual-insertion-shortcode-or-php-function-call-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9687145)
 * Hello,
 * I’m not sure whether I understand your problem correctly.
 * How have you used the shortcode?
    How have you implemented PHP function call 
   or custom hook?
 * Please enable remote debugging:
    [https://wordpress.org/support/topic/ad-inserter-support-how-to-ask-for-help/](https://wordpress.org/support/topic/ad-inserter-support-how-to-ask-for-help/)
 * In the space next to the logo you have the following code:
 *     ```
       <div class="header-ad">	
       <!--MONUMETRIC [ATF|Pos 1] D:728x90 T:728x90 M:320x50,320x100 START-->
   
       <div id="mmt-89db5b0f-7437-45eb-a506-b9a9d42365d8"></div>
       <script type="text/javascript" data-cfasync="false">$MMT = window.$MMT || {}; $MMT.cmd = $MMT.cmd || [];$MMT.cmd.push(function(){ $MMT.display.slots.push(["89db5b0f-7437-45eb-a506-b9a9d42365d8"]); })</script>
   
       <!--MONUMETRIC [ATF|Pos 1] D:728x90 T:728x90 M:320x50,320x100  ENDS-->	
       </div>
       ```
   
 * However, this code doesn’t show anything.
 * You have a lot of javascript errors on that page:
 * ![](https://i0.wp.com/i.imgur.com/rCiYLen.png?ssl=1)
 *  Thread Starter [nikkoboy](https://wordpress.org/support/users/nikkoboy/)
 * (@nikkoboy)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9688061)
 * Hi Igor,
 * Thanks for your help! I really appreciate. Sorry if I did not manage to properly
   explain my problem, it was indeed a bit blurry.
 * Basically, I want to make the space next to the logo, visible/accessible by Ad
   Inserter, and use this space for Ad Inserter ads.
 * #1. How have you used the shortcode?
    I tried both [adinserter name=”myAd”] and[
   adinserter block=”7″]
 * #2. How have you implemented PHP function call
    I used `<?php if (function_exists('
   adinserter')) echo adinserter (7); ?>`
 * #3. or custom hook?
    I went to “Ad Inserter settings” > tab “Hook” > and used“
   header-ad” hook in “action”.
 * The code in the space next to the logo, should be replaced by one of your shortcode,
   PHP function call or hook, once I will have been able to implement any of those
   solution.
 * Once again, I really appreciate your help.
    -  This reply was modified 8 years, 5 months ago by [nikkoboy](https://wordpress.org/support/users/nikkoboy/).
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9688327)
 * Are you sure `header-ad` hook exists in your theme?
 * If not you can make it there.
    You need to modify your theme file (very likely
   header.php, I suggest to create a child theme and not to modify the original 
   theme files) with something like this:
 *     ```
       <div class="header-ad">
       <?php do_action ('header-ad') ?>
       </div>
       ```
   
 * Then you configure it in Ad Inserter and use it as position for automatic insertion.
 *  Thread Starter [nikkoboy](https://wordpress.org/support/users/nikkoboy/)
 * (@nikkoboy)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9689409)
 * Hi Igor,
 * Thanks for your input! I had a look into the header.php file of my theme, and
   found a snippet which looks closely like the one your provided:
 *     ```
       				<?php if (wt_get_option( 'wt_header_ad' )) {?>
       					<div class="header-ad">	
       						<?php echo wt_get_option( 'wt_header_ad' ); ?>	
       					</div>
       				<?php } ?>
       ```
   
 * Since they almost look like the same, I’m not sure if this would change anything.
   I’ll give it a go to see if that changes anything (but it will likely deactivate
   the ad space from the theme’s settings).
 * FYI, I also tried and added wt_header_ad to the hook settings in Ad Inserter,
   but it didn’t work.
 * Cheers,
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9689456)
 * But there is no such hook as `wt_header_ad` in your file?!
 * In my post above you have the code for the hook if you wish to implement it.
 *  Thread Starter [nikkoboy](https://wordpress.org/support/users/nikkoboy/)
 * (@nikkoboy)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9689466)
 * Hi Igor,
 * I replaced
 *     ```
       <?php if (wt_get_option( 'wt_header_ad' )) {?>
       <div class="header-ad">	
       <?php echo wt_get_option( 'wt_header_ad' ); ?>	
       </div>
       <?php } ?>
       ```
   
 * By your code
 *     ```
       <div class="header-ad">
       <?php do_action ('header-ad'); ?>
       </div>
       ```
   
 * And it worked! The ad space is now available in Ad Inserter.
 * I think the issue was that the hook does work with do_action and not with wt_get_option.
 * Thanks again for your assistance!
    -  This reply was modified 8 years, 5 months ago by [nikkoboy](https://wordpress.org/support/users/nikkoboy/).
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9689479)
 * > I think the issue was that the hook does work with do_action and not with wt_get_option.
 * Of course!
 * > Thanks again for your assistance!
 * Please say it here:
    [https://wordpress.org/support/plugin/ad-inserter/reviews/](https://wordpress.org/support/plugin/ad-inserter/reviews/)
 *  Thread Starter [nikkoboy](https://wordpress.org/support/users/nikkoboy/)
 * (@nikkoboy)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9689507)
 * Thanks Igor! I’m rating your plugin 5 stars!! Awesome assistance, and fantastic
   plugin!!
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9689512)
 * 🙂

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

The topic ‘Manual insertion: Shortcode or PHP function call not working’ is closed
to new replies.

 * ![](https://ps.w.org/ad-inserter/assets/icon-256x256.jpg?rev=1502039)
 * [Ad Inserter - Ad Manager & AdSense Ads](https://wordpress.org/plugins/ad-inserter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-inserter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-inserter/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-inserter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-inserter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-inserter/reviews/)

## Tags

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

 * 9 replies
 * 2 participants
 * Last reply from: [Spacetime](https://wordpress.org/support/users/spacetime/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/manual-insertion-shortcode-or-php-function-call-not-working/#post-9689512)
 * Status: resolved