Opening a popup ninja from php

Checking the documentation from popup ninja plugin on how to open the popup from a link, the only available option is how to open from a blog post. But if you want to add the link in your website using php, you need to use the wordpress function do_shortcode. The documentation doesn’t show how to add a do_shortcode with content between the tags.

To open the popup with php, simply get the popup ID and use the code bellow. Just remember to change the text for your desired one.

< ?php echo do_shortcode( '[ninja-popup ID=1234]'.'text to open popup'.'[/ninja-popup]' ); ?>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.