Support
Support » Fixing WordPress » Change link depending on whether there are comments
(@joyced)
16 years, 8 months ago
I use to following code on single post pages to link to the comments section:
<a href="#comments"><?php comments_number('0 comments', '1 comment', '% comments'); ?></a>
However, when there are no comments the link goes nowhere. I’d like it to then be #respond instead of #comments, but I’m not sure how to do this. Any ideas? Thanks in advance.
D’oh. I didn’t realise I could just put the link inside the comments_number function.
(@joyced)
16 years, 8 months ago
I use to following code on single post pages to link to the comments section:
<a href="#comments"><?php comments_number('0 comments', '1 comment', '% comments'); ?></a>
However, when there are no comments the link goes nowhere. I’d like it to then be #respond instead of #comments, but I’m not sure how to do this. Any ideas? Thanks in advance.