WordPress.org Tips

< Back to ‘Tech Tips’

Insert an Anchor to a location on the same page

  • Type in ‘xxxx’ beside the location you are anchoring to. Click on ‘text’ and look for the ‘xxxx’. Replace it with this – <a name=”name”></a> (replace “name” with a keyword from the location you are linking to – remember the keyname!)
    • For example, on our ‘Mac Tips’ page, to link to ‘Screen shots…’ it would be this – <a name=”screenshots”></a>
  • Type in the title of your anchor (in our example: ‘Screen shots on a Mac’
  • <a href=”http://yourdomain.com/category/pagename/#name” target=”_top”>Name</a>
    • For example, on our ‘Mac Tips’ page it would be this – <a href=”http://personalcomputerteacher.com/mac-tips/#screenshots” target=”_top”>Screen Shots on a mac</a> (Source: http://wpfaq.org/site/anchors/)

Insert a ‘Back to the top’ link

  • Click on ‘Appearance’ > ‘Editor’ > header.php (OR ). Paste the following after the ‘<body <?php body_class(); ?>>’ line – <a name=”top”></a>
  • Go to the post(s) and click on ‘Text’ tab >paste the following at the end of the script (or where you want the anchor link) – <a href=”#top”>Back to the top</a>

Back to the top