If you change the “Comments container selector” in a way that it matches a container, that wraps also the comments and content, both the comments and the content are refreshed.
Another option is to use the ‘OnAfterUpdateComments’ callback. In this callback the variable newDom is defined that can be used to extract the new content to replace the existing one with.
Hope this helps…
Thank you for the quick reply. I can’t wrap content and comments together unfortunately, because of the style of the blog (previous and next post links will be wrapped into the same container as well and that would be a problem, of course).
I will try with the callback you suggested. I can’t try with “ajaxSuccess” event since it would generate an infinite loop. So thank you for the kind reply.
Manuel 🙂
Just… could you provide an example of the use of the callback… I assumed it was a classic hook or a javascript callback… I’m a bit lost, sorry.
Manuel 🙂
OMG, sorry, it is a field in the admin panel, I’m a poor stupid guy 🙂
But, however, I was planning to make my theme (commercial theme) compatible with your plugin by using code only, so, if I understand well, there’s no way, no PHP hook or jquery trigger, am I right?
Thank you. Manuel 🙂
Ok, I’ve fixed in this way, maybe it can help someone else with the same “strange” need, at least until a more elegant way will be found by the author, if he will want it:
1. saved somewhere the js var var wp_comments_post = "<?php echo site_url( '/wp-comments-post.php' ); ?>";
2. added the js function:
$( document ).ajaxSuccess(function( event, xhr, settings ) {
if ( settings.url == wp_comments_post ) {
//my function
}
});
Thanks. Manuel 🙂
Thanks for your feedback and great to hear, that you have solved your problems.
I will mark this topic as resolved.
Please think of writing a short review or making a small donation.
Thanks in advance,
Jan