Hi,
Thanks! There isn’t a way to do that directly, but you could hook into the code which fetches the comments from the database. I can send you a PHP code snippet if interested. Let me know.
Kind regards,
Andy
Yes, please send the code. I really appreciate it!
add_filter( 'better_recent_comments_comment_args', function( $args ) {
// Limit comments to a specific post ID
$args['post_id'] = 123;
return $args;
} );
You’ll need to replace ‘123’ with the actual ID of the post/page. You could also try using get_the_ID() to get the current page ID but I’m not sure that will work with caching. You could try it though.
-
This reply was modified 5 years, 4 months ago by
Andy Keith.
-
This reply was modified 5 years, 4 months ago by
Andy Keith.
Hi, Jill ( @jillbalkus ).
Thanks for your reply. I’m glad we could help!
Additionally, since our plugin doesn’t have an option that allows you to limit the displayed comments to only be pulled from a certain page, I have added it to our feature request list so that we can track the amount of demand for it. We will let you know if we add this to a future version of the plugin.
In the meantime, I’m sorry that this isn’t possible. I hope the custom PHP code snippet that we provided gets the job done for now.
Should you have any other questions, please let us know.
If it isn’t too much trouble, I’d love it if you would please be so kind as to add a review for Better Recent Comments at https://wordpress.org/support/plugin/better-recent-comments/reviews/ .
Many thanks and keep safe,
The PHP code worked perfectly!
Brilliant! Thanks for letting us know, Jill ( @jillbalkus ) and well done in applying it to your site.
This is a brilliant snippet! Worked perfectly for me too – thank you 🙂
Hi, @ukbestrong .
Thanks for chiming in and for using our Better Recent Comments plugin. Fantastic! I’m glad we could help!
Should there be anything else that we may assist you with, just let us know.
Best regards and keep safe.