[Resolved] Adjusting a hook for use with GP Elements

Home Forums Support [Resolved] Adjusting a hook for use with GP Elements

Home Forums Support Adjusting a hook for use with GP Elements

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #815880
    Adam

    Hey Tom and Team,

    I successfully added a modal popup contact form when someone clicks ‘CONTACT’ on our nav menu from the homepage. In order to make it work across the entire site, the author of the modal popup widget (Ultimate Addons Elementor) instructs me to put the following code in the theme/child theme functions.php file:

    function ultimate_elementor_modal_popup() {
    echo do_shortcode( '[uael-template id="your-saved-section-id"]' );
    }
    add_action('wp_footer', 'ultimate_elementor_modal_popup');

    I’ve tried to add it as a Hook to wp_footer (and wp_header) for the Entire Site but no success. I know I probably haven’t adapted the code to work as a GP Hook, but I don’t know any Javascript. Appreciate your guidance.

    Adam

    #815888
    epickenyan

    Use the code snippets plugin instead https://wordpress.org/plugins/code-snippets/

    #815912
    Adam

    I thought the hooks in GP’s Elements feature were suppose to replace code snippets. Either way, when I paste that code into a new code snippet using that plugin, still doesn’t work.

    #815955
    David
    Staff
    Customer Support

    Hi there,

    you shouldn’t need that snippet.
    Instead create a new Element Hook, select the WP_footer hook and add this part of your code only:

    echo do_shortcode( '[uael-template id="your-saved-section-id"]' );

    Check the execute PHP and Shortcode boxes and set your display rules.
    Of course make sure to add your your-saved-section-id in the shortcode.

    #815970
    Adam

    Hey David, thanks for the reply. Followed your instructions but no luck. Purged cache and tried in incognito browsers in both Firefox and Chrome. Loads on homepage and no where else. I’ve had luck with a few other simple hooks, but this one continues to evade me. If you have any other suggestions please pass along. I’m also starting a ticket with the Ultimate Addons for Elementor people.

    Cheers,
    Adam

    #815998
    David
    Staff
    Customer Support

    What if you just add the shortcode e.g:

    [uael-template id="your-saved-section-id"]

    Can you check your Display rules in the hook as well? Is it set to the Entire Site?

    #816008
    Adam

    Yep set to Entire Site. Both the code you recommended before and this new code just make the form show up below the footer on each page, but not upon clicking the nav menu item.

    #816010
    David
    Staff
    Customer Support

    i am not sure how that plugin works. Does it have any conditional display rules? If not then you may need to check with the plugin author

    #816016
    Adam

    Ok David, well I really appreciate you trying. I’ll see if they can help me. Cheers!

    Adam

    #816044
    David
    Staff
    Customer Support

    You’re welcome. Let us know how you get on or if the problem still exists and we can take another look.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.