如何停止联系表单7在提交后重新加载页面而不包含头文件中的wp_head?

时间:2017-09-05 06:33:50

标签: wordpress

我面临的问题是,联系表单7在提交后加载页面。我已经制作了单独的标题而没有WP_head包含。

我在单独的模板文件中使用:

 <?php echo do_shortcode('[contact-form-7 id="6039" title="Hire us pop up form"]'); ?>

请帮忙。

1 个答案:

答案 0 :(得分:0)

我通过在自定义头文件中添加这些脚本来解决这个问题

    <script>

    jvcf7_loading_url= "#/wp-
    content/plugins/contact-form-7/images/ajax-loader.gif";
    jvcf7_invalid_field_design = "theme_1";
    jvcf7_show_label_error = "errorMsgshow";

   </script>

   <script type='text/javascript' src='https:#/wp-
   content/plugins/jquery-validation-for-contact-form-
   7/js/jquery.validate.min.js'></script>

   <script>
   /* <![CDATA[ */
   var wpcf7 = {"apiSettings":
   {"root":"http:\/\/#\/wp-
   json\/","namespace":"contact-form-7\/v1"},"recaptcha":{"messages":
   {"empty":"Please verify that you are not a robot."}}};
   /* ]]> */
   </script>

   <script type='text/javascript' src='#/wp-
   content/plugins/jquery-validation-for-contact-form-
   7/js/jquery.jvcf7_validation.js'></script>