Title: Refresh entry content too
Last modified: August 22, 2016

---

# Refresh entry content too

 *  Resolved [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/refresh-entry-content-too/)
 * Hi, great plugin, my compliments.
 * I’m trying to refresh the “.entry-content” section when a comment is added, could
   you point me to the right direction please? Is there any “trigger” I can use 
   to check when a comment is successfully added? May I add somewhere this further
   section through the plugin options or maybe by using a hook you already put into
   your plugin?
 * Thank you in advance for your time. Manuel 🙂
 * [https://wordpress.org/plugins/wp-ajaxify-comments/](https://wordpress.org/plugins/wp-ajaxify-comments/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [janjonas](https://wordpress.org/support/users/janjonas/)
 * (@janjonas)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/refresh-entry-content-too/#post-5255664)
 * 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…
 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/refresh-entry-content-too/#post-5255740)
 * 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 🙂
 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/refresh-entry-content-too/#post-5255741)
 * 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 🙂
 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/refresh-entry-content-too/#post-5255742)
 * 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 🙂
 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/refresh-entry-content-too/#post-5255745)
 * 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 🙂
 *  [janjonas](https://wordpress.org/support/users/janjonas/)
 * (@janjonas)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/refresh-entry-content-too/#post-5255776)
 * 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

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Refresh entry content too’ is closed to new replies.

 * ![](https://ps.w.org/wp-ajaxify-comments/assets/icon-256x256.png?rev=2962290)
 * [Ajaxify Comments - Ajax and Lazy Loading Comments](https://wordpress.org/plugins/wp-ajaxify-comments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-ajaxify-comments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-ajaxify-comments/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-ajaxify-comments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-ajaxify-comments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-ajaxify-comments/reviews/)

## Tags

 * [trigger](https://wordpress.org/support/topic-tag/trigger/)

 * 6 replies
 * 2 participants
 * Last reply from: [janjonas](https://wordpress.org/support/users/janjonas/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/refresh-entry-content-too/#post-5255776)
 * Status: resolved