Yet another Ajax paged comments plugin for wordpress (YAAPC)

This Plugin provides Ajax enabled comments system with paging,posting and form validation to your WordPress blog.

image

Features:

  • Ajax page navigation

    When the user navigate through the comments via page selector,only the comments area will be send back to the client and refreshed,not the full page.This actually save your server load and bandwidth thus making your blog faster and more responsive. The paging system works even if JavaScript is disabled.

  • SEO friendly

    Pagination can cause a duplicate content issue with search engines.YAAPC can automatically generate “noindex,follow” meta tag in your paged comments page to avoid duplicate content in search engines that may hurt your rankings.(many thanks for Hank’s great comment and advice)

  • Ajax comment posting

    Posting comments via Ajax,without page refreshing.

  • Comment form validation

    validate the user input in comment form before sending to server. 

Download Yet another AJAX paged comments plugin for wordpress(YAAPC)

Demo and Testing

Click here for demo and testing.

please don’t comment to this post for testing purposes.

Installation

  1. Upload YAAPC to the `/wp-content/plugins/` directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. (Optional,but recommended) Modify your comments template(comments.php),add a div with id="yaapc-comments" to wrap the comment list area. Place <?php yaapc_pages()?> in where you want the page selector to show.take a look at the example bellow for details.
  4. Modify the style.css in YAAPC directory to custimize how YAAPC looks .

An example of a modified comments.php:

... ...
<!-- You can start editing here. -->
<div id="yaapc-comments">
<?php if ($comments) : ?>
	<h3 id="comments"><?php the_title();</h3>
	<?php yaapc_pages()?>
	<ol   class="commentlist">
	<?php foreach ($comments as $comment) : ?>
	... ...
	<?php endforeach; /* end for each comment */ ?>
	</ol>
	<?php yaapc_pages()?>
 <?php else : // this is displayed if there are no comments so far ?>
	<?php if ('open' == $post->comment_status) : ?>
		<!-- If comments are open, but there are no comments. -->
	 <?php else : // comments are closed ?>
		<!-- If comments are closed. -->
		<p class="nocomments">Comments are closed.</p>
	<?php endif; ?>
<?php endif; ?>
</div>
... ...

Administration UI

click for full image:

image

Q&A

  • How to display the comment number?

    Add <?php echo $comment->yaapc_number;?> to your comment template(inside loop).

Related posts:

TAGS: , , , , ,


158 Comments »

« Previous161514131211109...21Next »
fu On November 28th, 2011 at 6:58 am (#)

Hard to integrate with WP 3.0.1

Josh On July 7th, 2011 at 12:29 pm (#)

I've found one major issue with the plugin. If you view an attachment (i.e. /?attachment_id=xx), the plugin is forcing Wordpress to use the single.php template file instead of using MIME-type or attachment.php files.
I had to make a small modification at the template_redirect function of the plugin's PHP file, at the beginning, and added an additional conditional check if the requested page was an attachment, then return without redirecting.
                if ( (!is_single() && !is_page() ) || is_attachment() )
                        return;

Other than this, the plugin works great!

wahid On April 5th, 2011 at 2:22 am (#)

i dont what the matter but this plugin doesnt work on me

Belle On March 30th, 2011 at 9:19 am (#)

Wow, thanks! I'm using this plugin and I'm very pleased with it's performance. I didn't even have to restyle my comments, which you have to do with most Ajax plugins. However, I want to display my older comments first, and I noticed that this plugin displays the newer comments at the top. Is there anyway I can change this?
Thanks.

alex On March 15th, 2011 at 11:34 pm (#)

nice

Maurício Chades On March 7th, 2011 at 7:47 am (#)

Hi. This plugin is compatible with the wp 3.1?
 

Diego On February 2nd, 2011 at 8:58 am (#)

you should update this ! 

Mr.Confident On January 4th, 2011 at 2:28 pm (#)

I wondering if i bought a theme and it already had a comment plugin theme set for me and i added your ajex comment plugin would that disable my comments from showing up on my main and article page….please help, go to my page and you will see it for yourself…also please tell me what i can do to fix the problem…
thanks
confidentspot

Barbio On December 13th, 2010 at 8:01 pm (#)

 
Hello i have the twentyten template, and im not capable to make it work.
Can you please help me?
 
Original file
<?php
/**
 * The template for displaying Comments.
 *
 * The area of the page that contains both current comments
 * and the comment form.  The actual display of comments is
 * handled by a callback to twentyten_comment which is
 * located in the functions.php file.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */
?>
 
<div id="comments">
<?php if ( post_password_required() ) : ?>
<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></p>
</div><!– #comments –>
<?php
/* Stop the rest of comments.php from being processed,
* but don't kill the script entirely — we still have
* to fully load the template.
*/
return;
endif;
?>
 
<?php
// You can start editing here — including this comment!
?>
 
<?php if ( have_comments() ) : ?>
<h3 id="comments-title"><?php
printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'twentyten' ),
number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
?></h3>
 
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<div class="navigation">
<div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
</div> <!– .navigation –>
<?php endif; // check for comment navigation ?>
 
<ol class="commentlist">
<?php
/* Loop through and list the comments. Tell wp_list_comments()
* to use twentyten_comment() to format the comments.
* If you want to overload this in a child theme then you can
* define twentyten_comment() and that will be used instead.
* See twentyten_comment() in twentyten/functions.php for more.
*/
wp_list_comments( array( 'callback' => 'twentyten_comment' ) );
?>
</ol>
 
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<div class="navigation">
<div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
</div><!– .navigation –>
<?php endif; // check for comment navigation ?>
 
<?php else : // or, if we don't have comments:
 
/* If there are no comments and comments are closed,
* let's leave a little note, shall we?
*/
if ( ! comments_open() ) :
?>
<p class="nocomments"><?php _e( 'Comments are closed.', 'twentyten' ); ?></p>
<?php endif; // end ! comments_open() ?>
 
<?php endif; // end have_comments() ?>
 
<?php comment_form(); ?>
 
</div><!– #comments –>
 
 
CHANGED FILE
 
<?php
/**
 * The template for displaying Comments.
 *
 * The area of the page that contains both current comments
 * and the comment form.  The actual display of comments is
 * handled by a callback to twentyten_comment which is
 * located in the functions.php file.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */
?>
 
<div id="comments">
<?php if ( post_password_required() ) : ?>
<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyten' ); ?></p>
</div><!– #comments –>
<?php
/* Stop the rest of comments.php from being processed,
* but don't kill the script entirely — we still have
* to fully load the template.
*/
return;
endif;
?>
 
<?php
// You can start editing here — including this comment!
?>
<div id="yaapc-comments">
<?php if ($comments) : ?>
<h3 id="comments"><?php the_title();?></h3>
<?php yaapc_pages()?>
<ol   class="commentlist">
<?php foreach ($comments as $comment) : ?>
<ol class="commentlist">
<?php
/* Loop through and list the comments. Tell wp_list_comments()
* to use twentyten_comment() to format the comments.
* If you want to overload this in a child theme then you can
* define twentyten_comment() and that will be used instead.
* See twentyten_comment() in twentyten/functions.php for more.
*/
wp_list_comments( array( 'callback' => 'twentyten_comment' ) );
?>
<?php endforeach; /* end for each comment */ ?>
</ol>
<?php yaapc_pages()?>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!– If comments are open, but there are no comments. –>
<?php else : // comments are closed ?>
<!– If comments are closed. –>
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>
<?php endif; ?>
</div>
</div><!– #comments –>

M On November 28th, 2010 at 1:40 am (#)

Hard to integrate with WP 3.0.1

« Previous161514131211109...21Next »

Leave a comment


(will not be published)