Tell us what you are trying to do?
A business listing with a post relationship for a review. The form is on the business listing page and also displays on the same page.
When the review posts, the post is created by not displaying on the listing where the review was made.
Hi, can you take some screenshots of this View in wp-admin so I can see the configurations? Please be sure to include the Query Filter. If you cannot see the Query Filter section, scroll to the top right corner and click "Screen Options" to turn on the Query Filter panel. Include the screenshots with your next reply and I will take a look.
Please see attached. Thank you.
When the Review is created, is it linked to the Business Listing correctly in wp-admin?
If yes, try changing the View's post relationship query filter from "the current post in the loop" to the post where this View is displayed.
If no, the problem is most likely in the Form that creates Reviews. There should be a post relationship field in the Form, and the value should be set with the current post's ID using the wpv-post-id shortcode. You can hide the field with CSS if necessary.
Ok I found the post relationship field. My form looks like this:
[credform]
[cred_field field='form_messages' class='alert alert-warning']
<div class="form-group ">
<label>Rating</label>
</div>
[cred_field field='@business-listing-review.parent' class='form-control' output='bootstrap' select_text='wpv-post-id' order='date']
<div class="form-group ">
<label>Rating</label>
</div>
[cred_field field='form_messages' class='alert alert-warning']
<div class="form-group ">
<label>Rating</label>
[cred_field scaffold_field_id='overall-rating' field='overall-rating' force_type='field' class='form-control' output='bootstrap' label='Rating']
</div>
<div class="form-group ">
<label>Review Title</label>
[cred_field scaffold_field_id='post_title' field='post_title' class='form-control' output='bootstrap' label='Review Title']
</div>
<div class="form-group ">
<label>Your Review</label>
[cred_field scaffold_field_id='review-content' field='review-content' force_type='field' class='form-control' output='bootstrap' label='Your Review']
</div>
[cred_field field='form_submit' output='bootstrap' value='Submit' class='et_pb_button']
[/credform]
I have two issues:
1. Please see screenshot. The relationship field is a menu that requires the parent post be selected. The reviews will always be on the same page as its parent. How do I get the review to be related to the current page?
2. Second screenshot... I have a new problem. The text of the review is apparently an infinite loop. No idea how i've even done that.
Thanks,
1...The reviews will always be on the same page as its parent. How do I get the review to be related to the current page?
Use the wpv-post-id shortcode to set the value of this field to be identical to the ID of the current page. If you don't want to display this field to your visitors, wrap it in a div hidden with CSS. Here's a complete example of both:
<div style="display:none;">
[cred_field field='@business-listing-review.parent' class='form-control' output='bootstrap' select_text='wpv-post-id' order='date' value='[wpv-post-id item="$current_page"]']
</div>
2. Second screenshot... I have a new problem. The text of the review is apparently an infinite loop. No idea how i've even done that.
I'm not entirely sure, but it looks like you have a Content Template applied to this post. Then maybe you have added the same Content Template in the post content, or to a View inside the Content Template? I would have to take a closer look in wp-admin to see exactly what's happening. Please provide login credentials in the private reply fields here if you would like me to dig in deeper.
Can you upgrade this User to be an admin? I'm not able to see any Toolset information in wp-admin now.
The Template for the Listing Reviews View contains the Listing Reviews View, producing the infinite loop. Look here:
hidden link
You should remove the View shortcode from this template.
My issue is resolved now. Thank you!