Thanks for writing in.
If you are hardcoding the modal display through PHP and you want to use the WPForms shortcode, using the shortcode alone will not work. Instead, please use the do_shortcode
WordPress function.
Your code should look something like this:
<?php echo do_shortcode('[wpforms id="2810"]'); ?>
In case you would like to find more information about shortcodes in WordPress, please check here.
I hope this helps!
]]>But there’s another problem: I inserted this PHP code <? php echo do_shortcode(‘[wpforms id= “2810”]’); ?> into the file responsible for displaying the modal window, but when the window opens, the WP form is displayed in it, but for some reason, it doesn’t work as it should.
What do I mean by that:
1) The message isn’t sent, the invisible Google ReCaptcha doesn’t work;
2) For some reason, the submit-spin.svg icon is constantly spinning next to the form, which is located in the plugin folder /wpforms-lite/assets/images/submit-spin.svg
At the same time, if I insert the php code <? php echo do_shortcode(‘[wpforms id= “2810”]’); ?> to any other place on the website, the form works fine – the message is sent, the invisible Google ReCaptcha works, there is no rotating submit-spin.svg icon next to the form.
What could be the problem? Why does the form not work correctly only in the modal window?
]]>I checked and it looks like there are some JavaScript errors on your site.
Here is a screenshot for reference. This could be affecting some functionalities of WPForms that rely on JavaScript.
When you get the chance, could you please try using the steps in WPBeginner’s detailed guide on troubleshooting WordPress to see if it helps resolve the issue?
]]>We haven’t heard back from you in about a week, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.
Thanks!
]]>