Wednesday 6 July 2005 @ 6:53 pm
Ok, as promise to a blog buddy of mine, Kah Soon, that I will share a small plugin to show the post count in each for the the article as shown in the picture below.
Please follow the steps:-
- 1. Download Top10 plugin for WordPress.
- 2. Login to your database, either through phpMyAdmin or telnet.
Create a table called mostAccessed, by using this SQL query:-
[sql]create table mostAccessed
(
postnumber int not null,
cntaccess int not null,
primary key(postnumber),
unique id(postnumber)
);[/sql] - 3. Find this line to your index.php:-
[php]
< ?php if (have_posts()) : while (have_posts()) : the_post(); ?>
[/php]
Then add the following code below the line:-
[php]< ?php if ($id > 0) { add_count($id); } ?>[/php] - 4. Look for this line in index.php too:-
[php]< ?php the_title(); ?>[/php]
Then, add the following code below the line:-
[php]< ?php if (!( is_home() || is_page() )) { ?>
< ?php show_post_count($post->ID,
$before=”This post has been viewed “,
$after=” times since “); ?>
< ?php } ?>[/php] - That’s it. :)
The post count will appear whenever the single page of the article is shown.
Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post
Hey Kah Soon,
You actually have already downloaded the plugin and left a “very nice!” comment there. LoL
Anyway, hope my tutorial helps. :)
Hey Kah Soon,
You actually have already downloaded the plugin and left a “very nice!” comment there. LoL
Anyway, hope my tutorial helps. :)
Why everyone WP, WP leh. I use 2 MTs and one WP (neglected blog). My MT can do spam control like yours or not ha? ‘Cos spam is killing me even with MT blacklist. BTW, I link you as Bryan ah?
Why everyone WP, WP leh. I use 2 MTs and one WP (neglected blog). My MT can do spam control like yours or not ha? ‘Cos spam is killing me even with MT blacklist. BTW, I link you as Bryan ah?
Hi Lilian,
Yup, I’m bryan.
ErrR… Why WP ah? Because I’m using it mah. I have already been using WP since the beginning and this is my first ever blog.
This spam control is a nice plugin written by some really nice guy. Don’t know any nice guy using MT is willing to write a similar one. Anyway, before I used this spam control, I held every commment for moderation before been posted. But moderating thousand of spam is quite irritating. :( Spam problem is going rampant these days, sigh…
Hi Lilian,
Yup, I’m bryan.
ErrR… Why WP ah? Because I’m using it mah. I have already been using WP since the beginning and this is my first ever blog.
This spam control is a nice plugin written by some really nice guy. Don’t know any nice guy using MT is willing to write a similar one. Anyway, before I used this spam control, I held every commment for moderation before been posted. But moderating thousand of spam is quite irritating. :( Spam problem is going rampant these days, sigh…
Thank for making this valuable information available to the public.
Thank for making this valuable information available to the public.