Display Form Element Values in the Post

Every form element is stored in the WordPress database as "Custom Post Meta". If the form element is a taxonomy the value will be stored as taxonomy also.

WordPress Post Meta

You can display post meta in your theme files with get_post_meta. Read the WordPress documentation for more information.  https://developer.wordpress.org/reference/functions/get_post_meta/

Every custom field is stored as post meta and there are several functions to manipulate and display post meta. The complete documentation on custom fields can be found on the WordPress codex pages: https://codex.wordpress.org/Custom_Fields

Use a Plugin

There are several plugins for displaying post meta. We have created a small plugin to display your form elements(post meta) on the single post view or use a hook name to decide where the information should be displayed. You can find the plugin on WordPress.org  https://wordpress.org/plugins/buddyforms-hook-fields/

Use in your Theme Template

The best Practice is to create a custom page template for the post type single view and display the post meta within the template with the get_post_meta function. This will also give you a consigned design and you can manage your Custom Fields separate from your post content. See the WordPress.org codex links above.

Support Plugin or Theme Registered Post Types and Views

You can create form elements to support your theme or plugin. Often other plugin or themes create a gallery or any kind of view. If you want to support this views you need to make suer that the form element slug has the same name as the custom post meta used by the plugin or theme to generate the View.

Please also read this post. It will go into the topic in more deep and explore how to find the correct custom field name to use in your form element:  http://docs.buddyforms.com/article/152-integrate-any-custom-post-type-related-plugin-into-buddypress

Create Shortcodes or hook your values with php 

There are many whys to manipulate your output. It depend on your needs to decide what is best for you.

For advanced usage of form elements see this article in the developer section on "How to create a WordPress Gallery from the File Form Element" and hook it into the content or use as shortcode. If you are a developer the article should give you enough information to do anything with post meta:  http://docs.buddyforms.com/article/156-create-custom-gallery

Still have a question? Get in touch and let us know.

Still need help? Contact Us Contact Us