Forums

How do I correct broken comment anchor links? (6 posts)

  1. Torley
    Member
    Posted 4 years ago #

    I'm wondering how to fix broken comment anchor links. For example, on my blog's main page, http://torley.com , the default "Comment" link adds "#comments" at the end of an URL. Like this:

    ยป http://torley.com/soundsnap-rocks-what-are-your-fave-sound-search-sites#comments

    But, that doesn't actually anchor to the comments section. It still goes to the very top at the page. I've looked through the theme files but haven't found a clear way to fix this.

    How do I make it so #comments at the end will redirect to the top of the comments for a post?

    Many thanks in advance. :)

  2. iridiax
    Member
    Posted 4 years ago #

    Why are you using encoded urls?

  3. haochi
    Member
    Posted 4 years ago #

    Open your theme's comments.php file, find <!-- center-widget-title --> or <div class="center-widget-title">, then add id="comments" to <div class="center-widget-title">, like this:

    <div class="center-widget-title" id="comments">

    This should work but if it doesn't, post the comments.php file to http://pastebin.com and post the link here.

  4. Torley
    Member
    Posted 4 years ago #

    @iridiax: What's a better way? I'm just going with what my theme currently uses.

    @haochi: I didn't realize you could do that before. Thank you, I'll try that.

  5. Torley
    Member
    Posted 4 years ago #

    @haochi: Brill, that WORKED! Thanks a lot. If I could award points and glorify you more on here, I would.

  6. dogdayfear
    Member
    Posted 3 years ago #

    I have the same problem, and solutions proposed here didnt worked.

    Here is my comments.php file: http://pastebin.com/m5888f830

    Help will be appreciated. Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.