Gravity Form do_shortcode not working, the instant fix!

I was recently messing around with gravity forms for a form in my footer. I was bugged by the annoying function do_shortcode. For the life of me I could not figure out why the form would not show up. Finally I figured out that in order to use the do_shortcode function you have to echo the function’s response.

Incorrect:

 <?php  do_shortcode('[gravityform id="4" name="Footer Contact Form" title="false" description="false" ajax="true"]');?>

 

Correct:

<?php  echo do_shortcode('[gravityform id="4" name="Footer Contact Form" title="false" description="false" ajax="true"]');?>

 

Hope this helps someone!





Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

coded and designed by rob guilfoyle using wordpress

HTML5 Powered with CSS3 / Styling, Device Access, Graphics, 3D & Effects, Performance & Integration, and Semantics