Actually, I did not create a plugin but I wrote a code snippet that did this job for me.
Add these lines to comments.php in your active theme folder.
$comments_per_page = 5;
global $post;
$total = $post->comment_count;
if($total > 0) {
$apage=isset($_GET['apage']) ? intval($_GET['apage']) : 1;
$comments=array_slice($comments, intval(($apage-1)*$comments_per_page),intval($comments_per_page));
}
Insert this code right after if ($comments) statement
$commentCounter = (($apage-1)*$comments_per_page);
$from_page = $commentCounter+1;
if($apage == 1) {
$to_page = $comments_per_page;
if($total < $to_page) {
$to_page = $total;
}
}
else {
$to_page = $from_page + $comments_per_page - 1;
if($to_page > $total) {
$to_page = $total;
}
}
Insert this line where you want page links to appear in comments.php.
<?php echo paginate_links( array(
'base' => add_query_arg( 'apage', '%#%#comments' ),
'format' => '',
'total' => ceil($total / intval($comments_per_page)),
'current' => $apage
));
I think this is it. It should work. Give it a try and share your feedback via comments.
Tags: code-snippet, comments-pagination, Wordpress, wordpress 2.3, wordpress blog, wordpress-2.5, wordpress-mu
Posted in KAPISH, Wordpress | 17 Comments »
17 Comments | June 13th, 2008 | by Jaymin Patel
Shortcodes are awesome! This time I am showing photos from my flickr account to wordpress post.
Content from X'Mas in NY
Tags: Flickr, photos, shortcodes-api, wordpress-shortcodes
Posted in KAPISH | No Comments »
No Comments | April 23rd, 2008 | by Jaymin Patel
New in WordPress 2.5 is the Shortcode API, a simple set of functions for creating macro codes for use in post content. I thought let me see how it works! I am showing my google reader shared items within a post using shortcode.
Tags: google, google-reader-shared-items, shortcodes-api, Wordpress, wordpress-shortcodes
Posted in KAPISH | No Comments »
No Comments | April 16th, 2008 | by Jaymin Patel
Trying a WP 2.5 stable version (2.5-RC1). It’s awesome!
Tags: Wordpress
Posted in KAPISH | No Comments »
No Comments | March 20th, 2008 | by Jaymin Patel
Joomla is primed to be the next favorite Open Source Software, or that it already is? More on WordpressGarage.com
Tags: joomla, open-source-software, Wordpress
Posted in PHP, Wordpress, asides | No Comments »
No Comments | March 6th, 2008 | by Jaymin Patel
I was running wordpress 2.0.5 since 2 years and did not get time to upgrade to Wordpress 2.3.
So I decided last week to upgrade to Wordpress 2.3 and I did. I upgrade the same way how wordpress advice us here.
After installation, I did notice it has migrated my categories tables to wordpress 2.3 Terms tables but nothing migrated from Tags tables. I was surprised! Did I make any mistake? Then it comes into my mind, it is Ultimate Tag Warrior plugin, which has created those tables for me not Wordpress.
Now I had to migrate those tags from Tags table to Terms tables. So I wrote a script that does that job for me. I thought let me make that available to you, if someone would like to extend the script and build a smart plugin! read more »
Tags: php code, slug, ultimate tag warrior plugin, ultimate tag warrior tags tables, ultimate warrior, UTW, Wordpress, wordpress 2.3, wordpress tags, wordpress terms tables
Posted in KAPISH, PHP, Wordpress | 9 Comments »
9 Comments | February 7th, 2008 | by Jaymin Patel
Now it is so easy to add videos from 1000s of video sharing sites to WordPress blog with the Post to WordPress button
To make this video embedding process easier Vodpod introduced a “Post to WordPress” browser tool that works with hundreds of video sites and makes it easy to grab a video and publish it to your WordPress blog.
Tags: 1000s, video sharing sites, video sites, vodpod, wordpress blog, works with hundreds
Posted in KAPISH | No Comments »
No Comments | February 5th, 2008 | by Jaymin Patel
Tonny Bibbs has some questions regarding this deal. How does this going to affect PHP?
There are some news long time ago regarding “Zend and Microsoft partnered over a year and a half ago to improve native support for PHP under Windows and IIS”.
Maybe this is a good thing for PHP? Maybe there will be zero impact? What about technologies at Yahoo!?
Read more
Tags: bibbs, microsoft, Yahoo!, zend
Posted in KAPISH | 2 Comments »
2 Comments | February 1st, 2008 | by Jaymin Patel
I got an email from my friend this morning. I thought let me share it with you…
Mom came to visit her son Kumar for Dinner…..who lives with a girl roommate Sonia.
During the course of the meal, his mother couldn’t help but notice how pretty Kumar’s roommate was.
She had long been suspicious of a relationship between the two, and this had only made her more curious. Over the course of the evening, while watching the two interact, she started to wonder if there was more between Kumar and his roommate that met the eye.
Reading his mom’s thoughts, Kumar volunteered, “I know what you must be thinking, but I assure you, Sonia and I are just roommates.”
About a week later, Sonia came to Kumar saying, “Ever since your mother came to dinner; I’ve been unable to find the silver chutney jar. You don’t suppose she took it, do you?”
Kumar said,”Well, I doubt it, but I’ll email her, just to be sure.”
So he sat down and wrote:
Dear Mother:
I’m not saying that you ‘did’ take the chutney jar from my house, I’m not saying that you ‘did not’ take the chutney jar. But the fact remains that it has been missing ever since you were here for dinner.
Love, Kumar
read more »
Tags: chutney, dear mother, dear son, email, girl roommate, love, mom, relationship, roommates, sleep, sonia
Posted in General | No Comments »
No Comments | January 24th, 2008 | by Jaymin Patel
Some emails arrived in my Yahoo! Account are funny and real…
Letters ‘a’, ‘b’, ‘c’ & ‘d’ do not appear anywhere in the spellings of 1 to 99
(Letter ‘d’ comes for the first time in Hundred)
Letters ‘a’, ‘b’ & ‘c’ do not appear anywhere in the spellings of 1 to 999
(Letter ‘a’ comes for the first time in Thousand)
Letters ‘b’ & ‘c’ do not appear anywhere in the spellings of 1 to 999,999,999
(Letter ‘b’ comes for the first time in Billion)
And
Letter ‘c’ does not appear anywhere in the spellings of entire English Counting
Tags: yahoo account, Yahoo!
Posted in KAPISH | No Comments »
No Comments | January 21st, 2008 | by Jaymin Patel