Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?


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.

Browse other questions tagged or ask your own question.