Wordpress comments popup link trick
By hakan
Most of you see that lots of comments link display on different wordpress blogs like:
How can you organize your comments popup link like those?
It is easy, we use :
<?php comments_popup_link
('zero','one','more','CSSclass','none');
?>
code for it.
Here :
zero
(string) Text to display when there are no comments. Defaults to ‘No Comments’.
one
(string) Text to display when there is one comment. Defaults to ‘1 Comment’.
more
(string) Text to display when there are more than one comments. ‘%’ is replaced by the number of comments, so ‘% so far’ is displayed as “5 so far” when there are five comments. Defaults to ‘% Comments’.
CSSclass
(string) CSS (stylesheet) class for the link. This has no default value.
none
(string) Text to display when comments are disabled. Defaults to ‘Comments Off’.
( Taken from Codex Wordpress )
So you can use this code like I did on readywpthemes.com:
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
Here “%” is count of comments
or to see your links in between ( ):
<?php comments_popup_link('Comments (0)', 'Comment (1)', 'Comments (%)'); ?>
or you can create your style
I hope this is helpful for someone…
Topics: Worpress Tricks |


Comments
Thank You! I didn’t know that i can add css classes.
Bye, Eugen
So thanks I wasn’t know this code
I will use this code
thanks, it helped a lot !
thanks, it helped a lot !
Trackbacks