Archived topic
Add an Element to a popup
1 reply · Started by Vicky on March 10, 2022
Hello, I've created a hook element with some content, I'd like to add this element to a popup if possible - I'm using popup maker plugin.
Under Display Rules (Location) for the Element I've selected my popup, but I'm not sure which hook to use.
Thanks in advance,
Vicky
Hi there,
if you want the GP Element to appear inside the Popup then the popup template would need to contain a Hook.
Hooks are simply a PHP function that developers can add inside there templates ... but not all developers add them.
Options:
a. Check with the Plugin Developer to see if there are any Hooks available.
OR
b. create a portable hook that can be added using a Shortcode like so:
1. Add this PHP Snippet to your site:
function db_hook_inside_shortcode($atts, $content = null) {
ob_start();
do_action('db_inside_popup');
return ob_get_clean();
}
add_shortcode('hooky_shortcode', 'db_hook_inside_shortcode');
2. In your Popup maker template add this shortcode: [hooky_shortcode]
This will output a hook called: db_inside_popup
3. In your GP Element set the Hook to Custom Hook and add db_inside_popup