Pages
Categories
Archives
- March 2013
- January 2013
- November 2012
- October 2012
- September 2012
- July 2012
- March 2012
- January 2012
- November 2011
- September 2011
- July 2011
- March 2011
- February 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- December 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- November 2007
- July 2007
- November 2006
- October 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- May 2005
- April 2005
- March 2005
- December 2004
- November 2004
Paged Comments FAQ
Most of these questions are taken from the comments posted on the Paged Comments plugin page. If you have a question that is not answered here, please post it on the plugin’s page.
Note: these answers apply to the latest version of the Paged Comments plugin running on WordPress 1.5 or 2.x. If a solution does not work for you, please make sure you’re running the latest version of the plugin.
Q: Can I use the plugin with older versions of WordPress?
Paged Comments 2.6.4 was the last release to support WordPress versions 1.5 up to 2.5. You can download version 2.6.4 or one of the earlier versions from the WordPress plugin directory.
Q: Why do I keep getting fatal errors to do with eval()’d code?
Note: This problem cropped up frequently with earlier version of the plugin. Versions starting from 2.6.4 should work fine for most people experiencing this problem.
If you’re using version 2.6.4 or later, and you’re still experiencing this problem, you can avoid the eval statement by explicitly calling the
paged_comments_template()function instead ofcomments_template(). To do this, open the templates in your active theme and look for calls to comments_template()—these will most likely be insingle.phpandpage.php. Replace the call to comments_template() with this:The plugin looks for paged_comments_template() in your template file, if it’s found we assume you’ve modified your template for use with the plugin, and so you avoid the eval() call. If it’s not found, the plugin will replace calls to comments_template with paged_comments_template and eval the resulting code.
I would still like to hear from anyone experiencing eval() problems since 2.6.4—I don’t think anyone should be experiencing this with the latest release.
Q: Is there a way to determine if a comment page has been requested or not?
Yes. When a user clicks on a comment page number, the requested page is stored in PHP’s predefined $_GET variable associated with the ‘cp’ key. It’s enough to check for the existence of this key to know if a comment page has been requested or not.
For example:
<?php if (isset($_GET['cp'])) echo 'comment page requested'; ?>Bear in mind that a comment page is usually active by default when a comment-laden post is loaded. The method above only tests for explicit comment page requests.
Also, the value stored at
$_GET['cp']is not reliable to use—a user could request comment page 999 whether it exists or not!Q: Can I hide the post body when users navigate to a comment page?
Yes. Edit single.php and/or page.php, qualifying the call to
the_content()with an if statement. For example:becomes
If you’d like to guide visitors back to the full content, you can include an else statement with a link to the main article:
Q: Can I hide the postmetadata paragraph when users navigate to a comment page?
Yes. Open single.php and, using the conditional statement described earlier, replace this chunk of code:
with
Q: Can I hide the comment form when users navigate to a comment page?
Yes. The procedure is similar to that of hiding the post body. Open comments-paged.php and wrap the conditional statements around the
<form>element. For example, replace this chunk of code:with