• Resolved bucke

    (@bucke)


    Hello,

    I am trying to use custom fields to rewrite the author email in different posts by the author. Is this possible?

    What I have by now from the template is the code that emails something to the autor:

    wp_mail( get_the_author_meta('user_email'), __('Contact "', 'appthemes').$post->post_title.'"', $message, $headers, $attachments );

    If I simply put in a custom field user_email in the post it doesn’t seem to work. Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bucke

    (@bucke)

    Ok I fixed it by adding this before the code I pasted above

    $custom_mail = get_post_meta($post->ID, 'custom_email', true);
    if ($custom_mail != '') {
    wp_mail( $custom_mail, __('Contact "', 'appthemes').$post->post_title.'"', $message, $headers, $attachments );
    }

    im trying this but its not working, where do you place this code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom fields for author email’ is closed to new replies.