Title: 3rd request for help for simple code&#8230;.
Last modified: August 19, 2016

---

# 3rd request for help for simple code….

 *  [frumgenius](https://wordpress.org/support/users/frumgenius/)
 * (@frumgenius)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/3rd-request-for-help-for-simple-code/)
 * Hi! thanks for clicking on me….
 * Im sorry for using an eye-catching title, but this may be the only way to get
   ppl to help..
 * Here’s my issue:
 * 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?
 * Someone suggested that I put in the followiing code instead:
 * `<a href="<?php comments_link(); ?>"><button type="button"><?php comments_number('
   No comments &raquo;','1 comment &raquo;','% comments &raquo;'); ?></button></
   a></p>`
 * All that did was make the text underlined in the button…
 * I sincerely appreciate any insight…Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [pandusetiawan](https://wordpress.org/support/users/pandusetiawan/)
 * (@pandusetiawan)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/3rd-request-for-help-for-simple-code/#post-937111)
 * Can you give me your website link, so maybe i can get a better picture about 
   what you trying to do.
 *  [chowell18](https://wordpress.org/support/users/chowell18/)
 * (@chowell18)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/3rd-request-for-help-for-simple-code/#post-937112)
 * Sounds like you just need to link to the Post URL and/or append the “#comments”
   variable to the end of the URL.
 * You might also look at the button code itself… Does the button tag support an
   action or destination?
 * 
 *  [SimonJ](https://wordpress.org/support/users/simonj/)
 * (@simonj)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/3rd-request-for-help-for-simple-code/#post-937114)
 * > **frumgenius wrote :** 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.
 * The <button> tag should be used in a form, and what will happens when you click
   on it is set with an “onclick=” value…
 * That’s why your code link to nowhere… 😉
 * Look at this code :
 *     ```
       <form>
       <input type="button"
       value="<?php comments_number('no responses','one response','% responses'); ?>"
       onclick="window.location.href='<?php comments_link(); ?>'">
       </form>
       ```
   
 * OK… Here, the “onclick” value is set to open a window location, with a link to
   the comments (the php template tag from wordpress)… That should work…
 * And note the first “value” :
 *     ```
       value="<?php comments_number('no responses','one response','% responses'); ?>"
       ```
   
 * This is what will be displayed on the button… Here, I choose to put the number
   of comments or the “no comment”…
 * You can write there anything you like… Like this :
 *     ```
       value="Comment this post!"
       ```
   
 * —
 * Another workaround could be to use the code you already have in a div class instead
   of a `<button>`, and style this div as you like to look as a button…
 * S.
 * Hope this help…

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘3rd request for help for simple code….’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 4 participants
 * Last reply from: [SimonJ](https://wordpress.org/support/users/simonj/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/3rd-request-for-help-for-simple-code/#post-937114)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
