PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Function For inserting Gravity Form anywhere in single.php

  1. JordashTalon
    Member

    I'm trying to insert one of my Gravity Forms into a sidebar, I tried this:

    <?php
    global $wp_embed;
    
    echo $wp_embed->run_shortcode('[gravityform id=2 name=RollUp Carriage Door title=false description=false]');
    ?>

    But that doesn't work, isn't there a function?

    Posted 13 years ago on Friday July 29, 2011 | Permalink
  2. JordashTalon
    Member

    Oh and I can't use a widget because I need to insert a different form based on a custom field I enter into each post.

    Posted 13 years ago on Friday July 29, 2011 | Permalink
  3. JordashTalon
    Member

    NVM Found it in the Documentation:

    <?php gravity_form($id, $display_title=true, $display_description=true, $display_inactive=false, $field_values=null, $ajax=false); ?>

    Posted 13 years ago on Friday July 29, 2011 | Permalink
  4. JordashTalon
    Member

    Oh but it Didn't Include the CSS, how do you make it include the CSS with a Function call?

    Posted 13 years ago on Friday July 29, 2011 | Permalink
  5. When you add a form using the function call rather than the shortcode, you need to manually enqueue the styles and scripts.

    Please review this FAQ item:
    http://www.gravityhelp.com/question/my-forms-styles-arent-being-loaded-properly/

    Posted 13 years ago on Friday July 29, 2011 | Permalink