Title: Shortcode not working while triggering with php
Last modified: July 1, 2019

---

# Shortcode not working while triggering with php

 *  Resolved [subhamkotnala](https://wordpress.org/support/users/subhamkotnala/)
 * (@subhamkotnala)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/shortcode-not-working-while-triggering-with-php/)
 * Hi,
    I am unable to display pop up while triggering with php. My short code is[
   wpterms id=”2230″]. I want to display the pop up using php code such as : {echo
   do_shortcode( ‘[wpterms id=”2230″]’ );} Pop should be displayed on the home page.
   I have tried enabling and displaying the pop up option on that page,but still
   the pop does not appear. I have set the cookies expiry time to 0. The pop up 
   working fine when enabled for the page without any php code. Can you help me 
   with this? Thank you.

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

 *  Plugin Author [Link Software LLC](https://wordpress.org/support/users/linksoftware/)
 * (@linksoftware)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/shortcode-not-working-while-triggering-with-php/#post-11693100)
 * Are you getting any PHP specific errors when trying to do this? do_shortcode 
   is working fine for me with the latest release. Maybe try taking out the brackets
   containing the function call? Sorry, it’s difficult to debug other’s code without
   seeing the whole setup.
 *  Thread Starter [subhamkotnala](https://wordpress.org/support/users/subhamkotnala/)
 * (@subhamkotnala)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/shortcode-not-working-while-triggering-with-php/#post-11693748)
 * Hi,
    This is my code :
 * `echo do_shortcode( '[wpterms id="2230"]' );`
 * Can you show me how you are using the do_shortcode?
    And also should i enable
   the pop up on that particular page from the backend option? Thank you
 *  Plugin Author [Link Software LLC](https://wordpress.org/support/users/linksoftware/)
 * (@linksoftware)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/shortcode-not-working-while-triggering-with-php/#post-11694026)
 * I’m using it just like your example.
 * You shouldn’t have to do anything special in terms of setting options on a page
   or anything via the admin. Are you trying to view your site while you are logged
   in via the admin still? If so, make sure you have the “Enable popups for logged
   in users?” setting checked.
 * Can you send me the URL to the site you are trying this one? support [at] linksoftwarellc[
   dot] com
 *  Thread Starter [subhamkotnala](https://wordpress.org/support/users/subhamkotnala/)
 * (@subhamkotnala)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/shortcode-not-working-while-triggering-with-php/#post-11694745)
 * Yes, I have this
 * > Enable popups for logged in users?
 *  setting checked.
    Link to my site is : [http://login.norla.se/](http://login.norla.se/)
   You will have to log in to my site to see the functionality. If you can share
   me your email or something then I can share you my credentials. Thank you
 *  Thread Starter [subhamkotnala](https://wordpress.org/support/users/subhamkotnala/)
 * (@subhamkotnala)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/shortcode-not-working-while-triggering-with-php/#post-11698499)
 * Hi, I can see that the pop up is getting triggered with cookies. That’s why my
   shortcode is not working. How can I stop that?
    I want to trigger that shortcode
   with my code everytime. How can I achieve it? Thank you.
 *  Plugin Author [Link Software LLC](https://wordpress.org/support/users/linksoftware/)
 * (@linksoftware)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/shortcode-not-working-while-triggering-with-php/#post-11702017)
 * Cookies are a key part to how the plugin works so unless you want to rewrite 
   it to use sessions the only option for you is to set the expiration time to 0.
   You’ve said that’s not working for some reason so I’m not sure how much the base
   plugin, without modifications, can help you.
 * This support forum is meant to fix issues with the plugin but you’ve made repeated
   threads that are more about modifying the plugin than sorting out actual bugs.
   You might be better off finding another popup solution or making your own from
   scratch to better suit your needs.

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

The topic ‘Shortcode not working while triggering with php’ is closed to new replies.

 * ![](https://ps.w.org/wp-terms-popup/assets/icon-256x256.gif?rev=2788347)
 * [WP Terms Popup - Terms and Conditions and Privacy Policy WordPress Popups](https://wordpress.org/plugins/wp-terms-popup/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-terms-popup/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-terms-popup/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-terms-popup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-terms-popup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-terms-popup/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Link Software LLC](https://wordpress.org/support/users/linksoftware/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/shortcode-not-working-while-triggering-with-php/#post-11702017)
 * Status: resolved