I have a multi author blog site. Instead the reader contact the author through the site-wide contact form, I want each author has their own contact form so the reader can easily reach them.
Can CF7 do this?
You can use
[_post_author_email]for such cases.
How about i want to implement the contact form in each of the author page (author.php)? Seem the contact form doesn’t allow [_post_author_email] tag. Is there anyway to do so?
[_post_author_email]needs to be inside the loop. So doesn’t work on a author.php page it seems. And the solution ron_dev posted got the problem, that the email-adress got written in the html-source-code. By the way if you use Contact Form 7 – Dynamic Text Extension you got this problem too.
It would be nice to got another special mail tag for this purposes.
I tried it with
$curauth = get_userdatabylogin($author_name); elseif ( '_author_email' == $name ) $output = $curauth->user_email;
$curauth = get_userdata(intval($author)); elseif ( '_author_email' == $name ) $output = $curauth->user_email;
inside of special-mail-tags.php but with no luck.
It seems the only possibility without changing the code of CF7 is to use
[_post_author_email]and create an empty loop on author.php and paste CF inside. But the author needs posts for that and it feels wrong.
$autor = $curauth->user_nicename; $args = array( 'posts_per_page' => 1, 'author_name' => $autor ); query_posts($args); while ( have_posts() ) : the_post(); echo do_shortcode( '[contact-form-7 id="442" title="my_form"]' ); endwhile;
Oh yeah, It feels so dirty…
- The topic ‘[Plugin: Contact Form 7] Contact Form for each author??’ is closed to new replies.