Support » Fixing WordPress » !!!Comment link Button!!!

  • Hey everyone! I was getting feedback that the comment link on the bottom of each post was being ignored because it blended in to everything else.

    Thus, I wanted to create a comment button.

    I succeeded in making a button that displays the amount of comments on each post with the following code in index.php:

    <button type="button"> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></button></p>

    Problem is that the button doesn’t link anywhere.

    Simple question—-what do I have to add to make the button link to each post’s comments?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Anybody with any insight on this?

    Wait a sec… isn’t there already a link generated inside the button? comments_popup_link() generally spits out an anchor tag with the single post URL already included.

    I dunno. For some reason the button does not do anything. It seems that this code just puts the amount of comments on the button. Example: 3 Comments>>

    If anyone needs to see this in action….here is a link to my blog.

    Thanks a brazillion…

    Please assist. Thanx.

    Moderator Jan Dembowski


    Brute Squad and Volunteer Moderator

    …Buttons, why does it have to be buttons…?

    Try this instead

    <a href="<?php comments_link(); ?>"><button type="button"><?php comments_number('No comments &raquo;','1 comment &raquo;','% comments &raquo;'); ?></button></a></p>

    Nothing Doing. Thanks for the try though. All that this code did was underline the text in the button. Still not linking though….

    Anyone else with any insight?

    Moderator Jan Dembowski


    Brute Squad and Volunteer Moderator

    Weird. When I wrap the button in it works for me. When I do it the way you posted I get a button to nowhere.

    Good luck.

    Really? That’s interesting…..Doesn’t work for me…..

    Does anyone else have any input on this topic???

    Is anyone out there?

    I still don’t understand why the link isn’t working. If you still insist on a <button>, however, you could use JavaScript instead:

    <button type="button" onclick="javascript:location.href='<?php comments_link(); ?>'"><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></button>

    It’s not the best (or most semantically correct) solution, but it should work.

    Alternatively, why not just use CSS to style the comment link? Simply wrap the comments_popup_link template tag in a <span> or <div> and use style rules to duplicate a button effect.

    Where are you placing your code? At the bottom of each post?

    Does anyone know if this problem has been fixed (or what’s causing it)? I only just realized after a week (since upgrading) that my Comment links are missing. 🙁

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘!!!Comment link Button!!!’ is closed to new replies.