The PHP Condition

The PHP Condition lets you write your own PHP code and return a true or false to display or hide the popup from the current page.

You can find a collection of ready-to-use PHP scripts here.


When trying to compare against the current post/page, you should use the following snippet:

global $post;
// Use $post to run your checks against the current post/page
return $post->post_type === 'post';

The reason is that when using just global $post, or get_post(), it will always return the FireBox post instance and not the parent.

Use Case

This rule is rather useful if you want to display a popup on scenarios such as if the user has a total of X on their cart and you want to provide an upsell or coupon or anything of that nature. This gives you the flexibility to display a popup under almost any circumstance.

Was this helpful?