Support » Plugin: Contact Form 7 » Where EXACTLY to put redirect code in theme files?

Viewing 3 replies - 1 through 3 (of 3 total)
  • If your theme is already calling in a JS file that you can just add it there or you can enque a new js file yourself and add it there. You embed js files by adding code to your functions.php

    This page will show you how to do it.

    https://stackoverflow.com/questions/19263390/wordpress-loading-multiple-scripts-with-enqueue

    Even if you copied that js snippet and added it to the bottom of your footer.php it would probably work but thats not ideal.

    Thank you Ricky55
    Do you mean I copy/paste this code into the theme functions file as is (changing the thank you page URL of course) :

    <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location = ‘http://example.com/’;
    }, false );
    </script>

    …Or do I have to change it first to a format that will work in the functions.php file?

    Same problem here!
    I’m not techy at all and having to change any theme template scares me A LOT. I don’t want to risk breaking my entire website doing that. And I can’t pay a tech guy to do it.
    It’s so frustrating that you’ve made it so complex now, I had it easily configured before you did those changes to the plugin.
    Besides, I have a customed child theme with no theme template, since it uses the one from the parent theme – and that means every time I update the parent theme I’ll lose your settings and will have to start all over again. Hate it.
    I’m considering switching to another contact form that can do it more simply, because right now all my contact forms stay dead at “sending” and the client doesn’t know it’s been sent and received.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where EXACTLY to put redirect code in theme files?’ is closed to new replies.