Let's see if that spits out the email correctly, if not my guess is that (even though you're still in a valid WP loop that get_the_ID() might not deliver the current post ID.
I added the debug code as you instructed and turned off ajax for that form. It worked!
But why? What is Ajax breaking"
Another concern is that I have numerous posts (business listings) on a page (a particular category of business). The form seems to be working now in non-ajax mode and the "Thank you for your comment" notification appears at the top of the form after I submit it. However, if I click on the Post title to go to the actual single post page and submit the form from there, the form works but the "Thank you for your comment" area is blank… there is no text in it at all.
Another issue is that since I have so many businesses on a particular page, it is not practical that I have the contact form for each business also on the same page. How can I have this set up so that there is simply a link to the appropriate contact form? Is that possible?
By the way, I tried to use -your- contact form and after filling it out and trying to submit it, it gave me an error that said "have nothing to say" even though it was completely filled out. I wanted to let you view a screencast but want that to be private. Can you email me?
### example: changes the name of the uploaded file in the email (adding a prefix taken form a form field)
if ( $setting == "adminTO" ){
if ( $oldvalue=='placeholder' ){ If ( $Ajaxpid<>'' ) $email = get_post_meta(get_the_ID(), 'email', true); else if ( get_the_ID()<>'' ) $email = get_post_meta(get_the_ID(), 'email', true); else $email = 'fallback@email.com'; return $email;
}
}
What is "fallback@email.com" ? Is that supposed to be an alternate email address of my choosing?
Am I supposed to leave in "return $email;" or is is "$email = 'fallback@email.com';" supposed to be be the last line?
And my only other quetion is how do I give users access to this form without having to actually include the entire form on each business listing? Would I use a "more" tag or something and just have the form show up on the individual post or what would you suggest?
Here is my updated code based on what you updated in your code…
### example: changes the name of the uploaded file in the email (adding a prefix taken form a form field)
if ( $setting == "adminTO" ){
if ( $oldvalue=='placeholder' ){
$email='';
If ( $Ajaxpid<>'' ) $email = get_post_meta($Ajaxpid, 'email', true); else if ( get_the_ID()<>'' ) $email = get_post_meta(get_the_ID(), 'email', true);
if ( $email=='' ) $email = 'info@myDomain.com';
return $email; } }
I've made sure that Ajax is enabled, the Extra Variables box is checked. When I attempt to submit the form now, I get the "One Moment Please…" and nothing happens. No email is recieved either.
Still no go. I fixed the capitalization issue but with Ajax on, the form still is not sending me the email although it indiates by the notification that it was sent.
I'm hoping that this is just a very simple error somewhere and hope we can resolve it soon. Let me know if there is anything else I can do or help you with to troubleshoot it.
Oliver, just wanted to touch base with you, concerning my earlier issue in #7. Thanks for your prompt reply. I figured it out! Turns out my husband upgraded my site, replaced a bunch of files and there went my customization. So sorry to trouble you about that!
Anyway, I am super-excited about v10. I'm going to wait until all the kinks are worked out before upgrading, but this is by far such a powerful thing to be able to do for the folks who are running websites that have directories, like me. Thanks again!