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.

Set a Post Format

  1. Hello, the theme I'm using "Grido" from http://www.themify.me uses Post Formats and I want my users to be able and upload images and the "Image" post format gets selected.

    I also want the user to be able and select "Video" which, they would then paste the video URL and the post would be set to "Video" post format... is there a way to do this? I looked a good bit but I'm not finding any instructions for this functionality..

    Thank you

    Posted 11 years ago on Thursday March 21, 2013 | Permalink
  2. You can create a drop down in your form which lists all the post formats you want the visitor to be able to select. Then, with a function linked to gform_after_submission, you can update the post format to the one selected by your visitor. Code something like this: http://pastebin.com/dYiQJqmY

    Be sure to get the name and case of the format exactly correct. The built-in WordPress post format is 'video' but your theme may use something different. You can use a label of Video and a value of video if that looks better to you. If you have only a few options, you can use radio buttons instead.

    UPDATE: this code was previously posted by David Smith, which should work as well (however, you will need to change gform_post_submission to gform_after_submission in this code, since that old hook was deprecated: http://www.gravityhelp.com/forums/topic/auto-select-post-format#post-30916 )

    Posted 11 years ago on Sunday March 24, 2013 | Permalink