I have really no idea why the needed CF7 scripts are not passed to wp_footer()
I had to manually add them to the footer using switching to other theme, get the output and then directly copy it to another theme.
…
-
This reply was modified 4 years, 11 months ago by xenoncz.
Sounds like there’s a javascript error, probably caused by your theme or another plugin. You have a link?
@jules-colle I have firstly tried the thing with disabling / enabling all the plugins but did not have really any impact.
Then I was looking for manual includes of jQueries and other scripts which could possibly mess this up. Also no impact (have the same constelation of scripts and it works with them)
Only thing which I did I copied the footers from my theme and then TwentyTwenty theme and compared them.
I saw immediatelly in the wp_footer() output the 4-5 things from CPF are not there.
To be precise those lines:
<script>
var wpcf7 = {"apiSettings":{"root":"http:\/\/localhost\/conference\/wp-json\/contact-form-7\/v1","namespace":"contact-form-7\/v1"}};
</script>
<script src='http://localhost/conference/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=5.1.6'></script>
<script src='http://localhost/conference/wp-includes/js/jquery/jquery.form.min.js?ver=4.2.1'></script>
<script src='http://localhost/conference/wp-content/plugins/bootstrap-for-contact-form-7/assets/dist/js/scripts.min.js?ver=1.4.5'></script>
<script>
var wpcf7cf_global_settings = {"ajaxurl":"http:\/\/localhost\/conference\/wp-admin\/admin-ajax.php"};
</script>
<script src='http://localhost/conference/wp-content/plugins/cf7-conditional-fields/js/scripts.js?ver=1.7.9'></script>
Omitted the rest, grabbed only following and it works:
<script src='http://localhost/conference/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=5.1.6'></script>
<script src='http://localhost/conference/wp-content/plugins/cf7-conditional-fields/js/scripts.js?ver=1.7.9'></script>
-
This reply was modified 4 years, 11 months ago by xenoncz.
-
This reply was modified 4 years, 11 months ago by xenoncz.
I have really no idea why the needed CF7 scripts are not passed to wp_footer()
I had to manually add them to the footer using switching to other theme, get the output and then directly copy it to another theme.
Well, this sounds like a problem with caching. Are you using any caching / optimization or minify plugins? They often include an option to clear your cache. (always recommended after installing/updating a plugin)
Or might also be caching on a higher level (hosting / browser)
@jules-colle
No caching at all.
Well I will quickly go through the WP settings again, but for plugins I am sure.
@jules-colle Would seem so, but switching though the themes is outputing the wp_footer() immediatelly.
I will see how it will look like on the hosting. So far this is on localhost.
Anyway thanks for brainstorm
That’s pretty weird… But if I understand correctly: everything works on twenty-themes? My guess would still be that you are not calling the wp_footer() function correctly. You could probably check this by quickly modifying the core wp_footer() function and add something like die('WP FOOTER GOT CALLED');
to see if the function is triggered at all.
You probably already know this, but I just want to get the obvious out of the way first. The best place to call wp_footer is right before the closing body tag in your theme’s footer.php
file, like this:
<?php wp_footer(); ?>
</body>
</html>
reference: https://codex.wordpress.org/Function_Reference/wp_footer