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.

Use Gravity Form in Text Widget

  1. OK, I am using a new StudioPress theme, Generate, for a site and it has a text widget where you can include code for a form (in this case mailchimp) to subscribe to the blog, etc.

    http://davidmarkbrownwrites.com/

    The current code I'm using for the form is:

    <form action="http://davidmarkbrownwrites.us1.list-manage.com/subscribe/post?u=37df5e2ebfbf529f941095a2e&id=1edce3322a" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" />
    <input type="text" value="Your Best Email" name="EMAIL" class="required email" id="mce-EMAIL" />
    <div class="response" id="mce-error-response" style="display:none"></div>
    <div class="response" id="mce-success-response" style="display:none"></div>
    <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" />
    </form>

    But what I WANT to do is be able to use my Gravity form that does the same thing, so he can track through gravity forms all those who subscribe to the blog. (I have a gravity form subscribe to the blog type form in the sidebar.)

    I just don't know how to do this.

    I tried using the short code, but no go.

    Is there a way to see the code for a particular gravity form?

    Posted 12 years ago on Thursday February 9, 2012 | Permalink
  2. Hi Seth,

    It would probably be easier to use the Gravity Forms widget and then integrate the form with MailChimp via the Gravity Forms MailChimp add-on. You would need at least a Business license to get access to the MailChimp add-on, but it is well worth the money! So easy to setup. :D

    Posted 12 years ago on Wednesday February 15, 2012 | Permalink
  3. Thanks David,

    I have the MailChimp add-on.

    The issue is the "Generate Box" uses a text widget. So I need to put text/ html in this text widget. I've tried using the gravity form short code and it doesn't work.

    So, I'm assuming there's someway to actually find the HTML form code that Gravity Forms uses. That's what I need!

    Thanks!

    Posted 12 years ago on Wednesday February 15, 2012 | Permalink
  4. Hi Seth,

    The HTML form is dynamically generated when the shortcode or gravity_form() function is loaded. Unfortunately there is no static HTML form that Gravity Forms uses. Is the "Generate Box" (plugin/theme functionality?) typically support shortcodes? If not, seeing if there is a solution for this to support shortcodes would be your best bet. Alternately, if it could support a bit of PHP code, you could use the "gravity_forms()" function to include the form.

    Posted 12 years ago on Wednesday February 15, 2012 | Permalink
  5. Its a Text Widget. Text or HTML. However, I suppose I could try PHP in one of those advanced text widgets (I forget the plugin name). If I was to try that, what PHP code would I put in there?

    Thank you David.

    Posted 12 years ago on Tuesday February 21, 2012 | Permalink
  6. kyle
    Member

    You might just need to add:

    add_filter('widget_text', 'do_shortcode');

    to your theme's functions.php file.

    Posted 12 years ago on Tuesday February 21, 2012 | Permalink
  7. Kyle, you are a freaking genius! Perfect. Thanks.

    Posted 12 years ago on Wednesday February 22, 2012 | Permalink
  8. cluckie
    Member

    Did this ever work? Where do we add the new code? In the themes Functions.php or the Generate box functions.php?

    Posted 11 years ago on Tuesday November 13, 2012 | Permalink
  9. @cluckie, do you mean the code in this post:
    http://www.gravityhelp.com/forums/topic/use-gravity-form-in-text-widget#post-50141

    That code goes in your theme's functions.php and just tells WordPress to process shortcodes inside widgets.

    If you are having trouble using Gravity Forms, please begin a new topic and ask your question there. We'll be happy to help you.

    Posted 11 years ago on Tuesday November 13, 2012 | Permalink

This topic has been resolved and has been closed to new replies.