Categories
Tutorial WordPress

{Gravity Forms Shortcode Explained|Gravity Forms Shortcode – A Detailed Explanation}

This post is about Gravity Forms, a WordPress contact form plugin.

I know about Gravity Forms…but what are shortcodes?

Think of shortcodes as a placeholder for where other content will be displayed: instead of “Insert a Gravity Forms form here,” we use the `gravityform` shortcode. Learn more about shortcodes on WordPress.org.

The Gravity Forms `shortcode` has five pieces:

`

Oops! We could not locate your form.

`

  1. `id` (required) – The ID of the form, as displayed on the Gravity Forms Edit Forms page in the Id column
  2. `name` (required) – The name of the form.
  3. `title` – Show the title to users? Default is true; set to “false” to disable
  4. `description` – Show the form’s description to users? Default is true; set to “false” to disable.
  5. `ajax` – Submit the form without refreshing? Default is false; set to “true” to enable.

Gravity Forms Shortcode Examples:

``
Will result in Form #1 being displayed without a title or description, with no-refresh entry submission.

The shortcode above could be read as:Insert Gravity Forms Form #1 here. Do not show the title or description. The form should use Ajax to submit entries.

``
Will result in Form #2 being displayed. The title and description will be displayed (they are true by default), and entries will require a page-load (ajax is off by default).

``
Will result in Form #3 being displayed. The title will be displayed, but the description will not. Entries will not require a page-load (ajax is turned on).

Any questions?

This post has been created to make explicitly clear how the Gravity Forms shortcode works. If you have any unanswered questions, please leave them in the comments below and they will be answered.

An (advanced) note about custom Gravity Forms shortcode attributes:

In Version 1.6.5 of Gravity Forms, a feature was added to allow for custom shortcode attributes to be added by other Gravity Forms add-on plugins. This means that there may be more pieces to the shortcode in the future!

By Zack Katz

Zack Katz is the founder of GravityKit and TrustedLogin. He lives in Leverett, Massachusetts with his wife Juniper.

13 replies on “{Gravity Forms Shortcode Explained|Gravity Forms Shortcode – A Detailed Explanation}”

Hey there! I have had to uninstall plugins from my WordPress blog because the CKEditor turned the shortcodes into literal text. I tried temporarily deactivating CK Editor (which kinda hurt, because it took an Ice Age to get it working correctly with CKFinder!) and activated the plugins I wanted on the site (A Business Directory and Contact Form) but then had problems with fonts and display.

Is there a way ’round this?
Cheers!

When I use the [directory] short code, I can’t specify which form I want the entries to come from. It defaults to the first one. How do I specify which form I want? Also, when I click on the “add a gravity forms directory” icon in the WYSIWYG editor, it does nothing.

Use [directory form=”#”] where # is the form id.

What browser are you using? Does e Insert Directory error occur when you disable all other plugins except Gravity Forms and this one?

Hi,
Is it possible to display entries in the front end (using any shortcodes by using form id)??

Comments are closed.