• Hello,

    I am using CF7 on a website. Unfortunately ajax is not working. It refreshes the page after submitting. I found out that the JS file, nor the CDATA part is being added, nor in my development site, nor in production with the full domain URL.

    If I add the following manually to the footer, it works well:

      <?php wp_footer(); ?>
      <script type='text/javascript'>
        /* <![CDATA[ */
        var wpcf7 = {
          "apiSettings": {
            "root": "http:\/\/127.0.0.1:8000\/wp-json\/contact-form-7\/v1",
            "namespace": "contact-form-7\/v1"
          }
        };
        /* ]]> */
      </script>
      <script src="<?php echo get_home_url(); ?>/wp-content/plugins/contact-form-7/includes/js/scripts.js"></script>

    It is not adding it nowhere. Nor in the pages with the forms, nor in other pages.
    I tried to troubleshoot it the following way:
    -I turned on twentynineteen – the same problem. Js. missing from the footer
    -I turned on all other plugins, the same
    -in production I have “Version 5.1.4” – in development I tried to upgrade it to the newest, but the same problem.
    -running WordPress 5.2.1 and it cannot be changed

    Any idea what else I can check?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘CF7 not adding js and api to wp_footer’ is closed to new replies.