Title: Compatibilty Question
Last modified: July 28, 2024

---

# Compatibilty Question

 *  Resolved [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/compatibilty-question/)
 * Hi,
 * I hope you’re well 🙂
 * Is it possible to trigger hustle pop-ups via javascript?
 * It seems the wordpress theme “Laytheme” does not fire the hook Hustle is looking
   for, but maybe I can trigger the pop-ups manually using the custom newpageshown
   event that Laytheme provides?
 * Please see relevant documentation here: [https://laytheme.com/documentation/custom-javascript.html](https://laytheme.com/documentation/custom-javascript.html)
 * I looked for the event to call in the Hustle Documentation but I couldn’t find
   an answer. Is there an event I can call?
   I’m thinking it may look as simple as
   something like below?
 *     ```wp-block-code
       <script>    window.laytheme.on("newpageshown", function() {        var pageId = $("body").attr("data-id");        if (pageId == "234") {            if (typeof Hustle !== 'undefined') {                Hustle.popups.show(popupID); // Replace with your actual Hustle popup ID            }    });});</script>
       ```
   

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [Nebu John – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport14/)
 * (@wpmudevsupport14)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/compatibilty-question/#post-17917525)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/),
 * I hope this message finds you well.
 * The following javascript can help trigger the Hustle Pop-up manually.
 *     ```
       let _hustle = '.module_id_1';
       HUI.popupLoad(jQuery(_hustle));
       ```
   
 * Please make sure to update the module ID.
 * Kind Regards,
    Nebu John
 *  Thread Starter [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/compatibilty-question/#post-17917556)
 * Hello,
 * Thank you for your quick reply.
   Although it appears that HUI is not defined. 
   Is there another object I should be referencing?
 * Kind Regards,
 * Sebastian
 *  Plugin Support [Williams – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport3/)
 * (@wpmudevsupport3)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/compatibilty-question/#post-17918048)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/),
 * Hope this message finds you well.
 * If Hustle Pop-up is not triggering using the code provided by my colleague it
   might be due to:
 * – The code is being triggered before the hustle library
    – The hustle library
   is not being added
 * Could you look for this library?
 * `hustle-ui.min.js`
 * It will be loaded/add in the bottom, inside the <body> element
 * Let us know.
 * Best regards,
    Laura
 *  Thread Starter [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/compatibilty-question/#post-17919404)
 * Hi,
 * Thanks so much for your reply.
 * You’re right the hustle library loads only if the first page visited has a pop-
   up active. But if the site session starts from a page without a pop-up assigned
   then the hustle library never loads.
 * I tried manually loading the script in the footer and that got rid of the error
   message in the console, but the pop-up still didn’t show.
 * So instead, I found a way to force the relevant pages to hard refresh so they
   are compatible with the hustle plugin. It makes the page load ugly, but it works.
 * There’s a probably a way to integrate the theme and the plugin, but I imagine
   it may be a lot of work! Please let me know if I’m wrong though and if it might
   be as simple as directing hustle to look for the newpageshown event with an m-
   u plugin or something.
 * In any case, thanks for your reply and I’m glad there’s a workaround.
 * Take care,
 * Sebastian
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/compatibilty-question/#post-17921855)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * Thank you for response!
 * I think the workaround that you came up with should be fine for now.
 * Unfortunately, the theme that you are using seems to be a premium theme so we
   don’t have a way to test it and check its code but from what you described – 
   Hustle is not using any non-standard hooks so it would mean that theme is either
   loading scripts in some non-standard way or trying to “forcefully” skip loading
   scripts that it “thinks” are not used.
 * In both these cases, this is something that should be addressed by theme developers,
   I’m afraid.
 * However, are you actually sure this is theme related? I mean, did you try switching
   theme temporarily e.g. to Twenty Twenty-Four and testing if that same thing happens
   or not? Or are you using some sort of additional optimization plugin on site?
   There are some that attempt to unload seemingly unused plugins on “per page” 
   basis and that could affect Hustle in case of popups that are set to trigger 
   only by a click.
 * I’m asking just to make sure that we are on the same side and if theme really
   is the culprit here.
 * Kind regards,
    Adam
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/compatibilty-question/#post-17943177)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * I hope you are doing well.
 * We haven’t heard from you in a while, I’ll go and mark this thread as resolved.
   If you have any additional questions or require further help, please let us know!
 * Best Regards
    Patrick Freitas

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Compatibilty Question’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popup/assets/icon-256x256.gif?rev=3446944)
 * [Hustle - Email Marketing, Lead Generation, Optins, Popups](https://wordpress.org/plugins/wordpress-popup/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popup/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popup/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popup/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/compatibilty-question/#post-17943177)
 * Status: resolved