Paged Comments: Ajax Style!

December 21st, 2005

This post serves to demonstrate my very flaky and highly experimental AJAX implementation of the Paged Comments plugin. I will be working on this over the next few days so expect lots of errors! :)

Excluding article body when navigating comment pages

December 21st, 2005

In response to Massimo’s question:

…would it be possible to have comments only in the first paged one, the one with the article body and NO article body text in the following pages?

example:
http://www.example.org/2005/08/12/my-article/
includes the article plus the first 10 comments
while
http://www.example.org/2005/08/12/my-article/comments/2
includes ONLY the following 10 comments with NO article and possible a link the the former page.

Many thanks.
Massimo.

A very simple solution would be to edit single.php (if you’re using the default theme), qualifying the call to the_content() with an if statement. For example:

<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>

would become

<?php if (!isset($_GET[’cp’])) the_content(’<p class=”serif”>Read the rest of this entry &raquo;</p>’); ?>

If you’d like to guide visitors to the full content, you can include an else statement with a link to the main article:

<?php if (!isset($_GET['cp'])) {
the_content('<p class="serif">Read the rest of this entry &raquo;</p>');
} else {
echo '<p>You are browsing comments, <a href="', get_permalink(), '">read full entry here</a>.</p>';
} ?>

Hello world!

August 13th, 2005

This WP setup is my test bed for experimenting with plugins and hacks.