Got a longer blog and you want to be able to direct people immediately to the correct spot in that blog post? You can, here’s how to link towards a specific spot on a webpage, thanks to something called an Anchor Link.
At the time of writing, the submenu Block items are not available for Posts, only for pages. But let’s say you want to create something like it for a Post, or create an Anchor Link. Let’s do this.
Creating the Link
First, you’ll need to create the link itself, but we’ll have to do it in HTML. To be able to write the link like this, you’ll need to change from the default view in your Editor, to “Edit as HTML”. You can find that behind the three dots options.
Once you’re in the HTML edit, add the link as seen here:
<a href="#PLACETOBE">My Link</a>
So in the Editor, it should look like this:
Where the link needs to go
Now, we need to decide where on the Post the link needs to go. First, add a Custom HTML block in the spot where your links needs to go towards.
Once that is in place, add this code to it:
<span id="PLACETOBE"></span>
And then it should look like this:
Make sure the id is the same word as the tag you’ve placed in the link before. Otherwise, the Anchor Link won’t work. You can change the word (do not use spaces in that word), but you just have to make sure the wording is exactly the same in the two spots.
Anchor Link ready!
If all is well, you’ll have created an Anchor Link! See how it works in this GIF below:
Sharing that Link
You might spot in the GIF that the word #PLACETOBE gets added to the URL. If you share that complete link, with the hashtag, people who visit that URL will immediately go towards that spot on the page.