Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1259517
    omkar13
    Participant

    Hi,
    I removed the default comment section i.e ‘Leave a reply’ section from all my posts and replaced it with the new contact form 7. previously “Book now” internal links on the posts used to point to the comment section at the bottom of the page, but these links are no more pointing to the new contact form 7.

    Link for example :http://emailholidays.com/bellagio-las-vegas

    If you click on “Book Now” link it does not go to the comment section of the page.
    I was using #book do the same.

    Is there any way to fix that on all the posts at once , instead of doing it manually on each post.

    I have used below code in functions.php.

    /Contact form on every posts
    function contactform_for_every_post( $content ) 
    {  if ( is_singular('post') ) 
    	{    $contactform = '[contact-form-7 id="8165" title="Inquiry For Quote"]';    
    	echo '<h3>Get a free custom made Holiday Quote. Enquire below:</h3>';   
    	echo do_shortcode($contactform); 
    	}
    }
    add_action('x_before_the_content_end', 'contactform_for_every_post');

    Is there any way i can provide Id to my contact form through above code.

    Thanks in advance.

    #1259667
    Rupok
    Member

    Hi there,

    You can just add an ID to the h3 headline you have added :

    /Contact form on every posts
    function contactform_for_every_post( $content ) 
    {  if ( is_singular('post') ) 
    	{    $contactform = '[contact-form-7 id="8165" title="Inquiry For Quote"]';    
    	echo '<h3 id="contact">Get a free custom made Holiday Quote. Enquire below:</h3>';   
    	echo do_shortcode($contactform); 
    	}
    }
    add_action('x_before_the_content_end', 'contactform_for_every_post');

    Now you can use #contact to point the form.

    Cheers!

    #1260744
    omkar13
    Participant

    Hi Rupok,
    That resolved the issue.
    Thank you very much for support.

    #1260831
    Darshana
    Moderator

    Glad we were able to help 🙂

  • <script> jQuery(function($){ $("#no-reply-1259517 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>