Site icon Hip-Hop Website Design and Development

Shortcode for Feedback and Remark Packing containers in Submit Loop

Is it potential to get the feedback and remark packing containers for every publish in a loop so customers do not need to navigate to the precise single publish web page to depart a remark (and as a substitute customers can depart feedback on the web page the place the loop is positioned)?

I’m making an attempt to create a shortcode for the remark packing containers to be positioned inside a loop however the under shortcode solely calls the remark field for the present web page or single web page as per WordPress Developer information.

https://developer.wordpress.org/reference/features/comments_template/

perform show_comments_shortcode() { 
 
  international $withcomments;
  $withcomments = true;
    
// This solely will get the present single or web page remark 
$showcomments = comments_template( '', true ); 
 
// Return Feedback for every publish in loop
return $showcomments;
} 
// register feedback shortcode
add_shortcode('show_comments', 'show_comments_shortcode'); 

Thanks for any suggestions upfront.