You may use a Formidable form and View to allow comments on a WordPress post or a View. WordPress allows comments, by default, on a post, but there are situations where using a Formidable form is ideal. You can check out our comments demo. There are two different ways to set up comments depending on whether you create posts with your form or not.
Set up comments on entries
If you are NOT creating posts with your form, follow the directions below to set up comments.
- Create a View for the form that you would like users to comment on (Form A). We'll call this View A.
- Select Classic or Grid for the View type.
- Add whatever you would like to the Listing Page Content box. Select the Text tab and add a link to the detail page:
<a href="[detaillink]">Detail page</a>
- Create a form for comments (Form B).
- Add any fields you would like.
- Add a hidden field with [get param=entry] as the default value.
- You will need to change 'entry' to the Detail Page Slug set in the View A's Advanced Settings.
- Return to View A and add this shortcode to the Detail Page Content box:
[formidable id=x minimize=1]
Replace x with the ID of Form B.
- Create a View for Form B. We'll call this View B.
- Select Classic or Grid for the View type.
- Add a filter that sets the hidden field equal to [get param=entry].
- You will need to change 'entry' to the Detail Page Slug set in the View A's Advanced Settings.
- Insert View B in the Detail Page Content of View A
- Publish View A on a page. Be sure to include "filter=1" View A's shortcode.
Set up comments on posts
If you are creating posts with your form, follow the directions below to set up comments.
- Create a View for the form that you would like users to comment on (Form A). We'll call this View A.
- Select Classic or Grid for the View type.
- Add whatever you would like to the Listing Page Content box. Select the Text tab and add a link to the detail page:
<a href="?entry=[id]">Detail page</a>
- Create a form for comments (Form B).
- Add any fields you would like.
- Add a hidden field with [post_id] as the default value.
- Return to View A and add this shortcode to the Detail Page Content box:
[formidable id=x minimize=1]
Replace x with the ID of Form B.
- Create a View for Form B. We'll call this View B.
- Select Classic or Grid for the View type.
- Add a filter that sets the hidden field equal to [post_id].
- Insert View B in the Detail Page Content of View A.
- Publish View A on a page. Be sure to include "filter=1" View A's shortcode.
Refresh page with new comment
If you would like to refresh the page when a new comment is submitted, you may do the following:
- Go to your Comment form Settings → Actions & Notifications page and select the Confirmation action.
- Click the Redirect to URL button. In the Redirect URL box, insert the following:
your-page-url/detail-page-slug/[100]
- Replace your-page-url with the URL of the page where the View is published.
- Replace detail-page-slug with the Detail Page Slug set in the View's Advanced Settings.
- Replace 100 with the ID of the Hidden Field in your Comments form.
- That's it! When a user submits a comment, the page will refresh with their comment included in the content.