WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some posts in a specific category that has a custom field called email.

I am getting the custom field values with the following code.

$email_values = get_post_custom_values("email",$post->ID);
if( is_array( $email_values ) )
{
    foreach($email_values as $key => $email_value );

}

I want to put this into the contact form 7 "To:" field . I tried the following but I am only getting 1 email address for all posts.

[dynamichidden recipient-email "CF7_get_custom_field key='email'"]

This code displays only the email custom field of the last post. How can I get the custom field of all posts?

Thanks

share|improve this question

closed as off-topic by kaiser Jul 24 '14 at 8:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.