[Resolved] [Plugin: Contact Form 7] URL Redirect if wp_footer not being called
For most people who arrive on this question from a Google search, the advice that you’re probably looking for is to add the following to the “additional settings” section of the Contact 7 admin within WordPress dashboard:
(see this post)
For others, you can modify the scripts.js file using the instructions from @jcstewart in that same post.
But for me, this hasn’t helped. I, unfortunately, removed the wp_footer tag from my theme because I have pages showing up in a thickbox page; when the thickbox is closed and reloaded, it would load an additional thickbox underneath (very frustrating).
How can I get around this?
No responses yet. Another day of trial & error testing.
I’ve discovered that I could call the thickbox feature in another way. In case you’re interested, I used this method:
<!– Begin Thickbox Initialization –>
<?php wp_enqueue_style(‘thickbox’); ?>
<?php wp_enqueue_script(‘jquery’); ?>
<?php wp_enqueue_script(‘thickbox’); ?>
<!– End Thickbox Inititialization –>
Originally, I had used a function in my functions.php file that called thickbox, but the problem was that the script was being called multiple times when my thickbox opened a page, which caused the thickbox to open multiple times after being closed and reopened.
Anyway, changing this allowed me to keep wp_footer, which supposedly was what was causing Contact Form 7 and on_sent_ok to not work. But that doesn’t seem to have fixed it (though it fixed my thickbox problem and I’m sure is the better way of accomplishing that task).
So I’m still wondering why Contact Form 7’s on_sent_ok method (placed in additional settings within the admin panel) is not redirecting to a URL that I’ve defined.
I’m using WordPress version 3.3.1 and Contact Form 7 version 188.8.131.52.
I’ve tried deactivating plugins to see if it was a conflict there, but that doesn’t seem to be the case.
When I fill out the form and click “send” the thickbox disappears and I see the cleared form with text confirming that the form was submitted correctly:
Your message was sent successfully. Thanks.
The URL looks like this:
This happens whether or not the form is run through thickbox, so thickbox is not the problem.
Yeah, I’m going to be one of those guys… who posts to his own posts. But I figure it’s good policy to respond when a solution is found.
I visited this post: http://www.magecreates.com/why-wont-my-contact-form-7-redirect-code-work/
Dani Mage had similar symptoms as I, so I tried adding the following code to the end of the message “Sender’s message was sent successfully” (replacing the URL with whichever page you desire):
I don’t think this was the best way to fix it, and I’d really like to know what is causing the conflict in the first place – my “additional settings” are not being honored. The “on_sent_ok” method is still not working for me. But this hack bypasses that step. It’s not seamless and not perfect, but I need to move on.
If anyone else has a better fix for this, please let us know. I’m sure Dani Mage and I would be happy to hear the answer.
- The topic ‘[Resolved] [Plugin: Contact Form 7] URL Redirect if wp_footer not being called’ is closed to new replies.