Hi,
I have been trying to place the shortcode [contact-form] in my single.php so author's don't always have to add the shortcode to their posts manually.
I added <?php do_shortcode('[contact-form]');?> right after the_content within the loop but the contact form does not show up.
Any idea why that is or can anyone give me a hint on how to do it right!?
I appreciate your help!!
do77
spideyrag
Member
Posted 1 year ago #
I was succesful in showing the form on the blog post from single.php but in the to field, i could not generate the author email dynamically.
need help in this.
<?php echo do_shortcode('[contact-form subject="My Blog" to="<?php echo the_author_email() ?>"] [contact-field label="Name" type="name" required="true" /] [contact-field label="Email" type="email" required="true" /] [contact-field label="Contact Number" type="text" required="true" /] [contact-field label="Comment" type="textarea" required="true" /] [/contact-form] '); ?>