WordPress.org

Ready to get started?Download WordPress

Forums

Comments link doesn't go to the comments (5 posts)

  1. jbickers
    Member
    Posted 5 years ago #

    Any idea why my comments link doesn't go down to the comments section of the post, but rather just loads the post itself and stays at the top?

    Using the following code:

    "><?php comments_number('Leave a comment','One comment','% comments'); ?>

    The site in question is culturemaven.com, in case you'd be willing/able to give it a look. Thanks!

  2. jbickers
    Member
    Posted 5 years ago #

    Crap. Forgot the code tag. Here's the whole thing:

    <a href="<?php comments_link(); ?>"><?php comments_number('Leave a comment','One comment','% comments'); ?></a>

  3. Whitegoodshelp
    Member
    Posted 5 years ago #

    I've found a fix that worked for me. I only just discovered I have this problem too as I use Firefox browser and everything worked fine. However, I just found whilst using Internet Explorer that none of my comment links actually went through the comments.

    All my links which I'd customised to say "no comments yet what do you think?" just went to the top of the article from the index page. If I scrolled down to the bottom of an article and clicked the comment link nothing happened.

    After finding this thread and being disappointed the answer was not here I tried to fathom it out myself. I remembered reading in a book some years back that when creating HTML anchor links it is best to use a specific method which I had always used.

    Checking the comments.php file I could see the use of <a href="#respond">Leave your comment</a>

    I found that the anchor link for responding to the comments link was as follows <a name="respond"></a>

    I changed this link to <a name="respond" id="respond">&nbsp;</a> And now my links work in Internet Explorer.

  4. wanderlustwp
    Member
    Posted 5 years ago #

    I had the same problem. Washerhelp's solution worked for me. Thank you!

    Note: I had a different line of code in my comments.php file that needed replacing. It took me a while to find because I was looking for the:

    But instead it turned out to be:
    <div id="respond">

    Replacing it with: ' '
    worked like a charm.

  5. wanderlustwp
    Member
    Posted 5 years ago #

    I had the same problem. Washerhelp's solution worked for me. Thank you!

    Note: I had a different line of code in my comments.php file that needed replacing. It took me a while to find, but it turned out to be:
    <div id="respond">

    Replacing it with: <a name="respond" id="respond">&nbsp;</a>
    worked like a charm.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags