Anchors — works on home page, not on individual pages

  • Unknown's avatar

    Hi everyone. I had a question regarding anchors.

    I’m using the DePo Masthead theme, and have inserted a link at the top of the posts on my home page to the comments section. It’s in gray and titled “Leave a comment”. When I click on the link while on the home page, it works fine. But if I access my posting either through another posting or through one of my pages (for instance, when I access “The 8,500-Pound Question” through the page titled “South of the Border”, clicking on the link takes me nowhere.

    The coding I inserted at the top to generate the link:
    <font color=”#747170″>Leave a comment</font>

    #comments appears to be an anchor that is built into the theme.

    I tried using my own anchor, adding #comment at the bottom of the page where I wanted the jump to appear, but encountered the same problem — the link worked on the home page, but not when I accessed an individual post through another part of the blog.

    Does anyone have any idea what is going on?

    Thanks in advance!
    ch

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Eesh. Did not mean for that coding to actually show up, which just demonstrates my lack of understanding of this stuff.

    Anyway. The coding I put in was as such:

    (a href=”http://cjhsu.wordpress.com/2009/10/15/the-8500-pound-question/#comments”)(font color=”#747170″)Leave a comment(/a)(/font)

    But with carrots where the parentheses are here.

  • Unknown's avatar

    I don’t think you are using anchors correctly.

    <a href="./#comments">Jump to 1st comment</a>

    <a href="./#comment">Leave a Reply</a>

    should work on all pages and posts.

  • Unknown's avatar

    Hi,

    Thanks for your suggestion. I tried inserting the coding you suggested in the page, and it does not work.

    The problem I’m having is not that the anchor doesn’t work at all. The problem is that the anchor works when I’m clicking on the generated link on the home page. But when I access the individual posting through another part of the blog, the link to the anchor does not take you anywhere.

    Thanks,
    ch

  • Unknown's avatar

    I’ve looked and am wondering if perhaps it has something to do with the fact that you’ve got two posts with the same title. Are you observing this behavior on your other posts?

  • Unknown's avatar

    Hi,

    Thanks for your reply.

    Yes, I am observing the problem with other posts too. The one titled “With a Twist” has the same problem, for instance.

    Thanks,
    ch

  • Unknown's avatar

    Then I’m out of ideas. I can see no reason the link wouldn’t work. Sorry.

  • Unknown's avatar

    Thanks anyways =). I appreciate your time & interest in helping…

  • Unknown's avatar

    (a href=”http://cjhsu.wordpress.com/2009/10/15/the-8500-pound-question/#comments”)(font color=”#747170″)Leave a comment(/a)(/font)

    first, those are badly nested tags. Second, font tag is deprecated, if you wanna change the color of a text use “span” tags. Example:

    <a href="YOUR_URL"><span style="color: #747170">your text</span></a>

    Now, if you want to link directly the comments part of one page (The 8500 pound question) from another (South of the Border) then you need to use absolute paths.

    In my following example, I’m linking to the comments section of your 8500 pound post:

    Comment on my 8500 pound post!

    the code for the above is this:

    <a href="http://cjhsu.wordpress.com/2009/10/15/the-8500-pound-question/#comments" title="The 8,500-Pound Question">Comment on my 8500 pound post</a>!

    And with the text color change it should look like this:

    <a href="http://cjhsu.wordpress.com/2009/10/15/the-8500-pound-question/#comments" title="The 8,500-Pound Question"><span style="color: #747170">Comment on my 8500 pound post</span></a>!

    Also, you might want to read this:

    http://csswiz.wordpress.com/2009/08/11/first-letter-or-any-letter/

  • Unknown's avatar

    Hi,

    Eesh. Thanks for the note. I knew the font tag was bad, but didn’t know what the alternative was. I have followed your advice and now changed the coding in the 8,500-Pound post to what you suggested under the line, “And with the text color change it should look like this…”

    But I’m running into the same problem: The “Leave a comment” link works when you click on it from the home page.

    But when you open the posting through another part of the blog, through the “South of the Border” section, for instance, clicking on the “Leave a comment” link takes you nowhere. In the address bar, after you click on the link, it says it’s bringing you to the comments section; but the actual display does not change — it does not bring you down to the comments section.

    Thanks,
    ch

  • Unknown's avatar

    Would you please leave the “leave a comment” link on the page you want it to be? I don’t see it, and without seeing it, I can give your further advise.

    Also, if you copied the code as I gave it to you, there shouldn’t be a reason why the link wouldn’t work… if it worked linking to the comments block from here, it should work from your other page and anywhere on the web.

    Thanks

  • The topic ‘Anchors — works on home page, not on individual pages’ is closed to new replies.