Title: Ajaxify Comments inside loop
Last modified: August 21, 2016

---

# Ajaxify Comments inside loop

 *  [gojkob](https://wordpress.org/support/users/gojkob/)
 * (@gojkob)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/)
 * I have comments inside a page loop, how can get Ajaxyfiy working?
    I works on
   single page.
 * Here is code for comments inside page loop
 *     ```
       <span class="collapseomatic" id="form<?php the_ID(); ?>">Kommentera (utan facebook-login)</span>
       								<span id="swap-form<?php the_ID(); ?>" class="collapseomatic" style="display: none;">Stäng</span>
       								<div id="target-form<?php the_ID(); ?>" class="collapseomatic_content">
       								<?php global $withcomments; $withcomments = 1; comments_template(“/comments.php”, true);?>
       ```
   
 * [http://wordpress.org/plugins/wp-ajaxify-comments/](http://wordpress.org/plugins/wp-ajaxify-comments/)

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

 *  [janjonas](https://wordpress.org/support/users/janjonas/)
 * (@janjonas)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4414959)
 * Do you have multiple comments form on one page?
    This scenario should work with
   the next version which is currently under development…
 *  Thread Starter [gojkob](https://wordpress.org/support/users/gojkob/)
 * (@gojkob)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4414961)
 * Yes i have. 🙂 Great 🙂
 *  [janjonas](https://wordpress.org/support/users/janjonas/)
 * (@janjonas)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4414969)
 * Please try out the new developer version 0.20.0 from here: [http://downloads.wordpress.org/plugin/wp-ajaxify-comments.zip](http://downloads.wordpress.org/plugin/wp-ajaxify-comments.zip).
 * A new option “Post container selector” was added which needs to match the elements
   that defines the different posts (that are shown on the same page). Please note:
   Each post container needs an ID attribute.
    A second new option “Comment pages
   URL regex” could be used to define a regex that decides (based on the URL) which
   pages contains comment forms are.
 * Hope this helps…
 *  Thread Starter [gojkob](https://wordpress.org/support/users/gojkob/)
 * (@gojkob)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4414979)
 * Tnx, i will try now 🙂
 *  Thread Starter [gojkob](https://wordpress.org/support/users/gojkob/)
 * (@gojkob)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4414980)
 * Hi i have this tag `<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>`
   
   in buddypress default theme, i tried with`#post-<?php the_ID()?>;`but it does
   work
 *  [janjonas](https://wordpress.org/support/users/janjonas/)
 * (@janjonas)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4414981)
 * Hi,
    the “Post container selector” needs to be a jQuery selector that is executed
   on client-side, e.g. you cannot use PHP expressions. Please try to use
 * `div[id^="post-"]`
 * If this does not help, please send me a link to your page where I can reproduce
   the problem…
 *  Thread Starter [gojkob](https://wordpress.org/support/users/gojkob/)
 * (@gojkob)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4414982)
 * It doesn’t work again :/
    Here is link of my page [http://markolukic.escentral.org/wordpress/](http://markolukic.escentral.org/wordpress/)
 *  [janjonas](https://wordpress.org/support/users/janjonas/)
 * (@janjonas)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4414989)
 * Have you set the option “Comment pages URL regex”? It needs to be a regex that
   decides (based on the URL) which pages contains comment forms are. You can try
   to set the option to “/.*/” to initialize the WP-Ajaxify-Comments on every page.
   
   If this does not work, please send me login data to enable me to test the comment
   forms on your page.
 *  [yesbutno](https://wordpress.org/support/users/yesbutno/)
 * (@yesbutno)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4415014)
 * hello,
    I have the same problem. my posts are in tags: `<div id="article-<?php
   the_ID(); ?>" class="sujet"></div>` After testing the settings you transmitted
   to us, (div[id^=”article-“]), I have these messages in firebug: `[WP-Ajaxify-
   Comments] Search comments container (selector: '#article-1 #comments')... Not
   found` etc I have sand you a MP with my website if you want to look. Thanks a
   lot for your work! yb

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

The topic ‘Ajaxify Comments inside loop’ 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/)

 * 9 replies
 * 3 participants
 * Last reply from: [yesbutno](https://wordpress.org/support/users/yesbutno/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/ajaxify-comments-inside-loop/#post-4415014)
 * Status: not resolved