Embedding an If-So trigger directly in your website files might be necessary in some cases, depending on how your site is built and what you want to achieve.
A common use case, is when you want to redirect visitors to another page based on one of the If-So conditions. Embedding a trigger directly in the page template will provide a better user experience since the redirection will take place before the content of the page starts to load.
To embed an If-So trigger in the page template, simply, click “PHP code (for developers)” right below the trigger shortcode on the trigger editing page. Copy the code, and paste it into your template.
Alternatively, you can use the “echo do_shortcode(‘…’);” function below, just make sure to replace the “XXX” with the ID of your trigger:
<?php echo_shortcode('[ifso id="XXX" ajax="yes"]'); ?>
If you want to enable Ajax loading for a specific trigger that is embedded directly in the page template using a PHP code, you can use the “echo do_shortcode(‘…’);” function