• 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)
  • Can you give me your website link, so maybe i can get a better picture about what you trying to do.

    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?

    3rd suggestion/option… Move the link tags within button tags (but before the PHP comment coding).

    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.