Since version 4.4.0, you can show related posts of any post easily, by pasting View shortcode with additional parameter to the post’s content editor.
Show related posts in same category
[pt_view id="VIEW_ID" cat="GET_CURRENT"]
Please replace VIEW_ID with ID of your View, and do not change the GET_CURRENT. Then the above code will show posts which have same category as the viewing post.
Show related posts in same tag
[pt_view id="VIEW_ID" tag="GET_CURRENT"]
Show related posts in same custom taxonomy “Testimonial”
[pt_view id="VIEW_ID" taxonomy="testimonial" terms="GET_CURRENT"]
You can replace “testimonial” by any custom taxonomy in your WordPress site.
Automatic detect taxonomy of current post, then get related posts
[pt_view id="VIEW_ID" taxonomy="GET_CURRENT" terms="GET_CURRENT"]
In above shortcodes:
– VIEW_ID is ID of the View which configures the desired layout
– GET_CURRENT is the constant which instructs CVPro to get current category, tag, taxonomy or terms of the current post
And certainly, you can set limit number of related posts easily by using the limit parameter, for example:
[pt_view id="VIEW_ID" cat="GET_CURRENT" limit=4]
Notice 1: It will show
No posts foundif there are no posts match the combination of shortcode parameters. In that case, please create new View for your purpose.
Notice 2: showing related posts by View doesn’t support Ajax pagination. It supports Non-Ajax pagination only.