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.

Short Code in Advance Custom Field will not display form

  1. I am using Advance Custom Fields and I created a Wysiwyg field type that allows short codes. I am using the default Wysiwyg content editor to display my test, but when I put the gravity form shortcode in the Advance Custom Field Wysiwyg editor it will not display on the site. After spending hours the only way gravity form short code will show up is if I put it in the main content editor.

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  2. You will have to ensure that shortcodes in custom fields are parsed in your installation. Please see this: http://nspeaks.com/insert-shortcodes-into-your-custom-fields/

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  3. I just tried the parsed function on the link, but it still does not work. The problem is, the if the shortcode for Gravity Forms is not in the Wordpress default text edit then it won't work. For instance, when the short code is in the Wordpress default text edit and in the custom field the gravity form shows up, but once I delete if from the Wordpress default text edit and have it only in the custom field it will not show up.

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  4. Gravity Forms can be embedded either by shortcode or by function call. The problem is, the shortcodes are processed before the custom fields are retrieved, so the shortcode which was just pulled into your post from the custom field will not be processed.

    Do you mean that the form won't display on the site, in this statement:

    when I put the gravity form shortcode in the Advance Custom Field Wysiwyg editor it will not display on the site

    Do you just see the shortcode in that case? Can you share the link to a page on your site where a form should appear, because there is a custom field with a shortcode stored in it?

    I'm not that familiar with the ACF plugin. How does the information in the custom fields get pulled into the post? Is there code in the template to do that?

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  5. You asked: "when I put the gravity form shortcode in the Advance Custom Field Wysiwyg editor it will not display on the site" Exactly, it will not display on the site. Doesn't show up.

    If I get rid of the_content(); and put this code in: the_field('field_name') ( this is where the gravity form short code is put in) it will just show the code, but if I do what you mentioned before by parsing the code nothing shows up.

    the only way Gravity forms will work is if it is in the Wordpress Default editor. So, if I have it in the editor and the custom field it will work, but once I take it our of the default editor nothing shoes up.

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  6. Basically the only way Gravity Forms will work is if it is in the Editor and the_content(); is called in the script

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  7. That's not true about the only way Gravity Forms will work. You can embed a form in a post or page by using the shortcode method, or you can embed it directly into a template file using the php function method. http://www.gravityhelp.com/documentation/page/Embedding_A_Form#Function_Call

    Some people have used PHP and do_shortcode as well, to run the function over the shortcode which would have been embedded in the post or page.

    I'm not familiar enough with how the data gets from the custom field into the post or page, but this can work. If you have stored the shortcode in a custom field which is associated with a post or page, you can get that form displayed in the page. It's a matter of how the information gets out of the custom field and is rendered to display the form in the page.

    Posted 11 years ago on Sunday February 17, 2013 | Permalink
  8. Unfortunately that is the case. I have dont this and tested it so many times that this is what's happening. The only way GF shortcode will show on the site is if you put it in the WordPress Default editor. Crazy, but I have exhausted this by way to many hours of searching and trying every type of method there is. Not sure what to do, but I can not use it.

    Posted 11 years ago on Monday February 18, 2013 | Permalink
  9. I'm sorry that did not work out for you.

    Posted 11 years ago on Monday February 18, 2013 | Permalink