Plugin Author
Damian
(@timersys)
Hi @capariciof,
you usually don’t want to use php to open the popup because of page cache (if you are using any)
But if you still need to do it, all you can do is wrap javascript code within your PHP conditional EG:
<?php if( condition ) : ?>
<script>SPU.open('123');</script>
<?php endif;?>
I do recommend using the shortcode generator or using pure html such as :<a href="#" class="spu-open-123">Click here</a>
You can use the spu-open-XXX class with any html element. Simple replace XXX with your popup ID.
If you like the plugin / support please leave a short review. It’s a tremendous help for us!
Thanks
Does this code need to be located in any special position?
Plugin Author
Damian
(@timersys)
not really, but at a side note, this won’t work on ajax mode because the code will be printed before the popup exists.