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.

Passing form to load via custom field

  1. bharvey42
    Member

    What I want to do is load a form on all pages of a specific post type.

    Depending on the type of post I want to load a different form in the post content.

    What I was thinking was using a custom field to store the ID and name of the form to be loaded in the post.

    However when I try to pass along those values while trying to load it via the short code (as well as populating other fields inside said form) it doesn't recognize the form and load it.

    Any ideas on the best way to pull something like this off is?

    Thank You

    Posted 11 years ago on Wednesday March 6, 2013 | Permalink
  2. I would add the form to a custom post type template you create for each custom post type. Then you can hard code the proper form into each template. I would not try to remember to put an ID on each post of a specific post type.

    Here is how to embed a form with PHP in a template:
    http://www.gravityhelp.com/documentation/page/Embedding_A_Form#Function_Call

    Here is how you use a template for each custom post type:
    http://codex.wordpress.org/Post_Type_Templates

    (basically, single-{post_type}.php for each custom post type, and all the templates can be the same with the only difference being which Gravity Form is embedded.)

    Posted 11 years ago on Tuesday March 12, 2013 | Permalink