HTML and anchor links

Discussion in 'Web Design and Development' started by jent, Nov 11, 2013.

  1. jent macrumors 6502a

    jent

    Joined:
    Mar 31, 2010
    #1
    At my nonprofit our web developers just made a few of our pages editable in WordPress so that we can edit them ourselves without needing to go through them. I understand a bit of the basics behind HTML, but I can't for the life of me figure out the correct formatting for anchor links.

    I'd like to set up a few anchor links for things like "Click here to jump down to section X," but for whatever reason I can't get anchor links to work. Any help is appreciated. Thanks!
     
  2. Dunmail macrumors regular

    Joined:
    Mar 27, 2009
    Location:
    Skipton, UK
    #2
    Hmm, I answered this prior to the forums getting hacked and it seems to have gone AWOL :(

    Links can be between pages:

    Code:
    <a href="https://en.wikipedia.org/wiki/Main_Page">Wikipedia</a>
    
    Or to an anchor within the same page:

    Code:
    <a id="fred" />
    
    <a href="#fred">Go to Fred</a>
    
    For SEO purposes have the link text be something related to where you are linking to rather than a generic "Click here for ..."
     
  3. jent thread starter macrumors 6502a

    jent

    Joined:
    Mar 31, 2010
    #3
    I will be back at work later in the week and able to try this out on our site.

    For the sake of completeness, I am pasting Dunmail's original reply to help anyone else that may be having HTML anchor issues in WordPress like me.

     
  4. trenthanover macrumors newbie

    Joined:
    Oct 4, 2013
    #4
    Hi

    <a id="top" />
    <a href="#top">Click here to go Top</a>
    You can try this code...
     
  5. jent thread starter macrumors 6502a

    jent

    Joined:
    Mar 31, 2010
    #5
    I spoke to our web developers who informed us that anchor links wouldn't work because of the nature of the website implementation; instead of the whole website being WordPress, it's just a portion of the site.

    Thus, HTML anchors don't work because they are limited to a section of the page instead of being page-wide. It's not what I wanted to hear but it makes sense.
     
  6. Dunmail macrumors regular

    Joined:
    Mar 27, 2009
    Location:
    Skipton, UK
    #6
    That doesn't make sense. Once the page is built up and sent to the browser then one part of the page is able to link to any other part. A URI would be useful.

    Are your developers using iframes?
     
  7. jent thread starter macrumors 6502a

    jent

    Joined:
    Mar 31, 2010
    #7
    Yup, the WordPress on each of our website's pages is in an iframe. Is there a way for me to use anchor links in my page and not have the fact that the WordPress is embedded in an iframe prevent users from enjoying these jump links?
     

Share This Page