When using HTML anchor (
<a>), it is necessary to insure that no two anchor tags on a page have the same name. Otherwise, the result of clicking on links can be unpredictable. Since WordPress may show several posts on a single page, this means that each post must use unique anchor names.
My old method
When I started this blog, I used the HTML string
<a href="#x"><sup>x</sup></a>, where to indicate a link to an item in the reference list, where x is the item number. The item in the list would then start with
<a name="x"></a> x.
This seemed to work fine, but then I tried using the links on the home page where multiple posts were displayed. Instead of going to the reference that I desired, it would go an anchor in another post that had the same name.
My new method
The first thing that I decided to do was to use unique prefixes for each post, such as
bb, etc. This post uses the prefix
The first item in the reference list is Unicode Character Table – Arrow Sets1. The superscript 1 at the end of the previous sentence is the link to item in the reference list and is coded as
<a href="#ab1" name="ab1b"><sup>1</sup></a>. The suffix of
b at the end of the name indicates that this is the anchor that points to anchor
The item in the reference list then starts with
<a href="ab1b" name="ab1">↑</a> 1. The up arrow ↑ is a special code entered as an HTML literal using the HTML tab of the editor or using special characters entered via the Visual tab of the editor.
I will eventually alter all of my posts in this way, but it may take a while.
- ↑ 1. Unicode Character Table – Arrow Sets, http://unicode-table.com/en/sets/arrows-symbols/. This
site lists the Unicode characters and the codes that are used to represent them.