shortcode – wpv-post-comments

Sometimes it is useful to add WordPress post Comments in a Content Template or a View. It is possible to build a shortcode to display it:

// Display post Comments shortcode
add_shortcode('wpv-post-comments', 'my_post_comments');
function my_post_comments() {
       $data = ob_get_clean();
       return $data;

comments_template() reference:

Then I can use this shortcode anywhere:


You can find this solution on this Toolset forum thread:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>