Feb 27

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 | 8 Comments »

8 comments | Add One

Comments

  1. Eugen Wirz - 03/9/2008 at 3:30 PM

    Thank You! I didn’t know that i can add css classes.

    Bye, Eugen

  2. Tamara - 07/20/2008 at 8:40 AM

    So thanks I wasn’t know this code

  3. Jose - 07/20/2008 at 8:40 AM

    I will use this code

  4. pipo - 07/20/2008 at 11:32 PM

    thanks, it helped a lot !

  5. pipo - 07/20/2008 at 11:32 PM

    thanks, it helped a lot !

  6. sbs başvuruları - 10/15/2008 at 8:49 PM

    Thanks for this necessery article I was searching like this

  7. antiquarian books - 12/11/2008 at 3:14 PM

    Thank you for this information. :)

  8. Fishing in Juneau Alaska - 03/4/2009 at 6:26 PM

    Thanks for the tips…. this will be a big help

Trackbacks

Leave a Comment

Name:

E-Mail :

Website :

Comments :

Advertisement
Advertisement
Advertisement

Search

ADD TO FAVORITES

Add to Technorati Favorites