I am trying to: show a child custom post type within a content template.
I have a parent custom post type of vendor and a child custom post type of vendor-review. I've a couple of vendors that have some dummy vendor reviews for them and I created a content template to display a single vendors content.
I visited this URL: hidden link
I expected to see: 3 vendor reviews underneath the vendor listing details.
Instead, I got: a blank.
I don't understand why.
I've attached a snapshot of my view's settings.
How do you setup the content template for single vendor post?
Please check this:
1) the post hidden link, does have child posts
2) Please try deactivate other plugins and switch to wordpress default theme, and test again
Hi there Luoy,
NO there are no child items on this post. If there were they would show up right at the bottom under Vendor Reviews, there two reviews that should show up and they don't.
The basic twenty twelve theme is active and the only plugins that are active are Types, Views & CRED.
It still doesn't work properly.
Thanks
Cathie.
If the parent post does not have child posts, why do you expect to see:
3 vendor reviews underneath the vendor listing details.
https://toolset.com/forums/topic/view-to-show-child-custom-post-type-within-a-content-template/#post-276343
If the problem still exists, please duplicate same problem in a test site, and fill below "private detail box", and point out the problem View URL and page URL, I need a live website to debug this problem
I have modified the problem content template:
hidden link
the codes from:
...
[wpv-view name="Vendor - Review Ratings & Comments"]
To:
...
[wpv-view name="vendor-review-ratings-comments"]
You are using special character "&" and " - " in the View title, so I suggest you try replace it with slug of View
More help:
Function ‘render_view’
Renders a view and returns the HTML output. This function takes an array as parameter, and you can pass one of these keys:
‘name’ => The View post_name
‘title’ => The View post_title
‘id’ => The View post ID
https://toolset.com/documentation/user-guides/views-api/
Thank you for your advice Luoy, I will remember this for other future builds.
🙂
Cathie.