I am trying to: create a comments system with CRED. I created post type (CRED Comments), created fields (CRED COmment Fields), make child-parent relationship, and then created CRED Comment Form. Then using layouts, I inserted CRED Comment form in single post type display in parent post type. CRED form is not working. It is displaying code:-
[cred_field field='reviewer-name' post='cred-comment' value='' urlparam='' class='form-control' output='bootstrap'][cred_field field='reviewer-phone' post='cred-comment' value='' urlparam='' class='form-control' output='bootstrap'][cred_field field='reviewer-email' post='cred-comment' value='' urlparam='' class='form-control' output='bootstrap'][cred_field field='review' post='cred-comment' value='' urlparam='' class='form-control' output='bootstrap']
Link to a page where the issue can be seen: hidden link
I expected to see: a CRED frontend submission form. When a comment is added, it goes under parent category automatically.
Instead, I got: Code
Your CRED Form content is not created with the Wizard but manually and is wrong.
Please head to the CRED form, delete the content and press " Autogenerate Form".
Save the form and re-test the front end where you should find the form working.
Hi. Form is working now. But there are two problems.
1. last lines show dropdown of parent items. this is a problem as I may have hundreds of parent posts. I want each child - cred comment form do go only in parent where it is displayed.
2. I am unable to show comments in layout of CPT
1. last lines show dropdown of parent items. this is a problem as I may have hundreds of parent posts. I want each child - cred comment form do go only in parent where it is displayed.
You can automatically define the parent post and hide this input field. Edit the CRED form and find the parent field code:
<div class="form-group">
<label>lawyer Parent</label>
[cred_field field='_wpcf_belongs_lawyer_id' value='' select_text='--- not set ---' class='form-control' output='bootstrap']
</div>
Replace the code above with the code below:
<div style="display:none">
[cred_field field='_wpcf_belongs_lawyer_id' value='[wpv-post-id id="$current_page"]' select_text='--- not set ---' class='form-control' output='bootstrap']
</div>
2. I am unable to show comments in layout of CPT
You should be able to create a View of Comments, filtered by parent, where the parent is set by the current page. Then place this View somewhere in the Lawyer Template Layout. If you need additional assistance creating a View of child posts, please create a separate ticket where we can discuss it in detail. We have more information about querying child posts here:
https://toolset.com/documentation/user-guides/querying-and-displaying-child-posts/
This is working. Thanks Christian Cox.
How to show all comments of cred form at one place in admin area so that they can be manually approved. WP comments has separate place or link. I tried to add a link through post type but it is not shown anywhere. Is it because CRED comments is a child-post? I ask this because it is not possible to keep checking all parent post entries for child posts. All child posts shild be visible at one place in admin area. See the pic attached
Okay great, it sounds like this ticket can be closed.
Thanks a lot Christian Cox for quick support.