Tagged: x
-
AuthorPosts
-
April 27, 2016 at 10:02 am #902351
Hi, I would like to add the contact form 7 automatically to every post. What would be the way to do it? I suppose altering the functions.php of my child theme?
Footer contact form doesnt work for me, as I need the info which post the user has seen when writing in.
Thank You!
April 27, 2016 at 10:08 am #902367Preferably I would also like to automatically add a headline above the contact form, if thats possible.
April 27, 2016 at 12:24 pm #902639This reply has been marked as private.April 27, 2016 at 6:53 pm #903220Hi There,
Thanks for writing in! You can add this on your child theme’s functions.php file.
/** Contact form on every posts */ function contactform_for_every_post( $content ) { if ( is_singular('post') ) { $contactform = '[contact-form-7 id="109" title="Contact form 1"]'; echo '<h3>Ich habe Interesse an Tobias</h3>'; echo do_shortcode($contactform); } } add_action('x_before_the_content_end', 'contactform_for_every_post');
Replace the [contact-form-7 id=”109″ title=”Contact form 1″] with your actual contact form shortcode.
Hope it helps, Cheers!
April 28, 2016 at 1:39 am #903593Thank You. The Contact form was successfully added. But I would like to have it right below the text. Above the share buttons. Also the custom form headline
So two minor questions are left:
1. How can I position the contact form above the entry share
2. Is there a way to use the individual title of each post e.g. “Tobias,37” in the added form headline?thank you very much.
here is my functions.php content as of now
/** Contact form on every posts */ function contactform_for_every_post( $content ) { if ( is_singular('post') ) { $contactform = '[contact-form-7 id="347" title="Kennenlernen"]'; echo '<h3>Ich habe Interesse</h3>'; echo do_shortcode($contactform); } } add_action('x_before_the_content_end', 'contactform_for_every_post'); /** entry share on every post */ add_filter ('the_content', 'entry_share'); function entry_share ($content) { return $content.( is_singular('post') ? '[share title="Weiterempfehlen" facebook="true" twitter="true" google_plus="true"]' : '' ); }
April 28, 2016 at 1:53 pm #904546Hi Alex,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
-
AuthorPosts