How to Create Anchor Tags in WordPress
- 1). Open the post for editing and switch to HTML editor mode.
- 2). Locate the section of the post you would like to direct users to, then add an anchor element in the following format:
<a name="example">Some Text</a>
This would create an anchor with the name "example." This name will be used in the next step when creating the link. - 3). Locate the section of the post where you would like to place the link, and add it in the following format:
<a href="/links/?u=#example">Link Text</a>
Notice that in the quotation marks is the name of the anchor, preceded by a # sign. This tells the reader's browser that the link goes to a specific section of the page. - 4). Save and then preview the page. Try clicking the link to make sure it directs you to the anchor correctly.
Source...