Contact Form 7 on Author Page

Posted in: Newspaper
Post count: 5

Hi,

I’m trying to setup a Contact Form 7 form on the author bio page so that the email address for the form receipient is dynamically created. I’ve followed instructions on this site – http://en.adamlaki.com/2015/09/23/dynamic-author-email-with-contact-form-7/

For some reason this isn’t working and I have a feeling the author email (user email) isn’t available on the author page template.

Do you have any ideas on how best to implement a contact form that gets sent to the author email address?

Any help would be much appreciated!

Thanks

Post count: 6535

Hi

You can use the do_shortcode function in author.php file like here: http://screencast.com/t/W0M6ZyLMyhttp://screencast.com/t/LaEz5azY
To obtain a dynamic form depending by author follow this steps:
-create a contact form for each author and complete it with its contact details: http://screencast.com/t/IfZHuS77R Each form will have a unique shortcode
-in author.php file you will need a condition like this: http://screencast.com/t/7EZaBKXCnm0

 <?php
                    if (the_author_meta('first-author-id')){
                    echo do_shortcode('contact-form-for-first-author');
                        }
                    elseif (the_author_meta('second-author-id')){
                    echo do_shortcode('contact-form-for-second-author');
                        }
                    ?>

To find the author id follow this link: http://screencast.com/t/UqX5wQ9CxIGw

Thanks!

  • This reply was modified 10 years by Andrei L..
Post count: 5

Thanks for such a detailed a quick reply Andrei! Really appreciate it. I’ll get on an implement that now.

Thanks again.

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.