Deal ends in:

SUMMER SALE! UP TO 40% OFF!
GET IT NOW watermelon

Can I embed a trigger directly in a page template?

Yes.

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.

Embedding the If-So trigger using a PHP code

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.

screenshot 20 41 3

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"]'); ?>

Didn’t find what you need?