How to display posts of a specific form to the public

Today a client ask how to display form submissions to the public. 

The Question
I'm looking for a way to display all posts from a particular form slug regardless of user. E.g. if the post was submitted by a BP Form (slug) and is public, I want to return it on a list. Would also be nice to sub-select by category.

The Answer
YES, It is possible in different ways. Let us look into it the different options.

Gutenberg
In Gutenberg, you can use the BuddyForms Block - List Submissions. Just select the form you like to query posts from in the block options.

DIVI Filter Grid Custom Query
If you use DIVI Filter Grid to display post lists in Divi you need a custom query. You can find the code used in the video here: https://diviplugins.com/documentation/divi-filtergrid/custom-query/

We only add these two parameters to the query to define the meta key and form slug we like to file the query for.
'meta_key' => '_bf_form_slug',
'meta_value' => 'THE FORM SLUG'

Video to see the process in detail.

Theme Custom Query
If you are a theme designer or developer you can create a custom query in your theme. Please read the documentation https://codex.wordpress.org/Custom_Queries

Just use '_bf_form_slug' as meta_key query and the form slug as value.


Still need help? Contact Us Contact Us