Support » Fixing WordPress » Change link depending on whether there are comments

  • Resolved joyced

    (@joyced)


    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.

Viewing 1 replies (of 1 total)
  • Thread Starter joyced

    (@joyced)

    D’oh. I didn’t realise I could just put the link inside the comments_number function.

Viewing 1 replies (of 1 total)
  • The topic ‘Change link depending on whether there are comments’ is closed to new replies.