Freelancer's Playground! Learn Programming, The Freelancer's Way

24Jan/105

Loading Contact-Form-7 Plugin Outside Post/Page/The_Loop

Hi, just want to share little snippet. I was developing wordpress site for my client and I want to use Contact-Form-7 (CF7) to speed-up my development time. I need to add form (custom form) outside the loop / post / page content. From CF7's documentation, there's no single text explaining how to do it.

So, I guess I have to get my hand dirty by crawling the code. Here's how I do that.
From anywhere on wordpress theme files, put this code to display your CF7 form:

<?php echo do_shortcode ( '[contact-form 2 "Banquet Inquires"]' ); ?>

Comments (5) Trackbacks (0)
  1. Thats exactly what I was looking for. I want to display a form in my category templates. Took me all afternoon to find this answer. Thank you.

  2. Thanks so much for thsi bit of code, exactly what I was looking for, you rock!

  3. Oh wow, thank you so much. You have no idea how much you helped me by posting this. I just spent 90 minutes fighting to integrate a regular CGI form script into my template (with no luck) and this just saved my day.

  4. You. Rock. Thanks!


Leave a comment


No trackbacks yet.

blog comments powered by Disqus