Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Created June 27, 2016 11:42
Show Gist options
  • Save strangerstudios/8ea1cc9bbba1087711d1dcc013b327b5 to your computer and use it in GitHub Desktop.
Save strangerstudios/8ea1cc9bbba1087711d1dcc013b327b5 to your computer and use it in GitHub Desktop.
Add a Popup Builder popup everywhere for non-members.
/*
Add a Popup Builder popup everywhere for non-members.
Replace [sg_popup id=1] with the shortcode for your desired popup.
Popup Builder is a plugin available in the WordPress.org Repo here:
https://wordpress.org/plugins/popup-builder/
*/
function my_pmpro_popup_builder() {
global $current_user;
if ( !pmpro_hasMembershipLevel() )
{
echo do_shortcode('[sg_popup id=1]');
}
}
add_action( 'wp_footer', 'my_pmpro_popup_builder');
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Membership Logic to Enable or Disable Popups for Popular WordPress Popup Plugins" at Paid Memberships Pro here: https://www.paidmembershipspro.com/membership-logic-enable-disable-popups-popup-maker-popups-optinmonster/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment