Hi,
can anyone give me a hint how I can integrate a box with the data of some custom post fields to a post? What I want to achieve is:
I want to have posts with reviews on books. I added a few custom post fields with the most important data about a book (like cover image, isbn, price and publishing company).
Now I want to display this info in a nicely designed info box in the post, best after the second paragraph. How can this be achieved? Can I use something like a shortcode in the post to define where the information box should be included? Any other options?
Thanks,
Martin
Dear Martin,
I suggest you setup the location of "info box" manually, for example:
1) Create a content template, for example "info-box-content", display those content:
like cover image, isbn, price and publishing company
2) Edit the post, find the location you want, put the content template shortcode into the post content, for example:
[wpv-post-body view_template="info-box-content"]
More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body
Outputs the content of the current post or renders a content template
Great, this are the hints I was looking for - and super how Toolset works! One question: I have created a view template like you wrote, saw once the right result.
Then I added some html to the view (and stripped it again as the following happened) - but now: the post body text does not show up anymore as long as I have the line
[wpv-post-body view_template="CB TPL Buchdetails"]
in it.
Any idea about that?
Martin
Please check these:
Edit the content template "CB TPL Buchdetails", make sure you did not put the shortocde in it:
[wpv-post-body view_template="none"]
If there is, please remove it and test again, it will conduct a infinite loop problem.
If there isn't, please try this:
deactivate other plugins and switch to wordpress default theme, and test again
If the problem still persists, please provide a database dump file(ZIP file) of your website in below private detail box, also point out the problem page URL, view URL, content template URL, where and how I can see the problem:
the post body text does not show up anymore as long as I have the line