Advertisement
Guest User

Untitled

a guest
Dec 12th, 2011
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php $num_comments = get_comments_number();
  2.  
  3. $num_comments = get_comments_number(); // for some reason get_comments_number only returns a numeric value displaying the number of comments
  4. if ( comments_open() ){
  5. if($num_comments == 0){
  6. $comments = __('No Comments');
  7. }
  8. elseif($num_comments > 1){
  9. $comments = $num_comments. __('Comments');
  10. }
  11. else{
  12. $comments ="1 Comment";
  13. }
  14. $write_comments = '<a href="' . get_comments_link() .'">'. $comments.'</a>';
  15. }
  16. else{$write_comments = __('Comments are off for this post');}
  17.  
  18.  
  19. ?>
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement