I am writing a blog, and want to be able to link externally to particular sub heading within this blog. How can I add an ID to content within the post body (RTF) ?
There are a few ways, depending on what you want.
ONE-OFF LINKING
Drop an HTML embed in your rich text content, just before your heading, and place something like
<span id="my-link"></span>
Then your link is to the page, affixed with #my-link
.
BLOG-WIDE HEADING LINK SUPPORT
If you want to be able to link to any heading, you can use a ToC package that auto-creates links from headings. Finsweet’s ToC supports this.
Here’s an example using that solution;
https://www.coachmike.live/blog/what-is-love#what-is-love
IN-TEXT MARKUP
Or, you might use Refokus Rich Text Enhancer, which allows constructions like;
[#my-link]This is my heading link here[#my-link]
and adds your link to the text.
Thanks for the response! I didn’t realise you could put HTML into the rich text as that would be an easy solution - however I just tried it, and it just displays as the string. Do I need to do something so it recognises it as code?
Just to be clear I am talking about a CMS blog entry rich text
Make sure you put in actual HTML if that’s what you want, like <span id="my-link"></span>
Cheers, I wasn’t using the insert code thingy, just putting it in. Thanks for the solution