Display Posts to the Public for Normal Unregistered Visitors of your Site

Most of the themes or plugins come with their own views to display submissions. If you use BuddyForms to create a form for an existing post type, the display part is most of the time already done because the theme or plugin is creating the post type. In this case, you only use BuddyForms for the frontend form and management of the user's submissions from the frontend.

If you have created your own post type and search for a way to list the post created by a form you can use the following Shortcodes.

Display Submission

[buddyforms_list_all form_slug="" query_option="list_all_published_posts" user_logged_in_only="false"]
Options:

  • form_slug  --> is required
    • This is the string to identify the Forms. 
  • query_option --> is optional 
    • Define how to get the submissions. 
    • Possibles values for this shortcode
      • list_all_published_post
        • List all published post
      • list_all_published_posts_by_meta_key
        • List all entries matching the `meta_key` and `meta_value` option
      • empty
        • If you leave empty they will show all entries submitted with the current from the `form_slug` option
  • user_logged_in_only --> is optional | values: true/false/logged_in_only
    • Define if the shortcode output will be available for logged in users or public users
  • post_type --> is optional
    • Post type to list by the shortcode, by default use the value set up in the setting of the form defined in the `form_slug`
  • meta_value --> is optional
    • Use with `meta_key`, this option is the value you against you want to verify the `meta_key` 
    • This option is only available if the query_option is `list_all_published_posts_by_meta_key`
  • meta_key --> is optional
    • Use with `meta_value`, this option is the key you need to search to compare with the `meta_value` 
    • This option is only available if the query_option is `list_all_published_posts_by_meta_key`
  • list_posts_style --> is optional | values: list/table
    • Define the style of the output.

Examples

[buddyforms_list_all form_slug="post-excerpt-amount-of-row" query_option="list_all_published_posts_by_meta_key" meta_key="number" meta_value="4" user_logged_in_only="false"]
[buddyforms_list_all query_option="list_all_published_posts" user_logged_in_only="true" post_type="post"]

Still need help? Contact Us Contact Us