Hello, I’m posting recipes on my Ghost blog. I want to do jump links that link to the recipe at the bottom of the post.
I’ve searched the forum and online and I found the answer BUT I don’t know how to implement it.
I can see that it works on his site but I don’t know how to get it to work on my site.
Can someone please explain in plain English how to do this? I am a former HTML developer and have been blogging on Wordpress for over a decade but I am not very familiar with Ghost.
If you add a heading to the section you want to add a jump link to (e.g. “Recipe”) then you can use that heading in the URL to create your link, like this:
yoursite.com/article/#recipe
If the heading has more than one word, use - to separate. Here’s an example from a real site: https://demo.ghost.io/design/#installing-ghost-themes
Ghost automatically allows you to make jump links with all headings in your posts. You just use the # identifier at the end of the URL to link to a specific section of your article, followed by the heading itself.
You need to swap out yoursite.com/test/ for the actual URL of your post, followed by the heading. If the heading is Mushroom Scallop Risotto Recipe, then it should be #mushroom-scallop-risotto-recipe at the end of the link.
@annmarie you’ve added your heading manually using a HTML card - in that case you won’t have an id automatically generated for you compared to using the built-in headers.
I’m trying this as well however my Heading already has dashes in it for example
The Brand Gap - Marty Neumeier
so how do I handle anchors since I was testing and it didn’t seem to work using #The-Brand-Gap—Marty Neumeier
Also how do I use the URL in the link if it’s still in preview with a preview URL can this only be don’t after the page is published?
When you preview the post, you can see exactly how dashes and such have been handled. You can also put in the URL as just #your-heading for the link (as long as it is on the same page), so it doesn’t matter that the page link is going to change when you publish.
I just checked hyphens. My heading was My big heading - with a hyphen, and Ghost gave me an anchor of my-big-headingwith-a-hyphen. Which is a little quirky, but certainly something you could get used to.
Hi @annmarie Saw your question here on the forum and I get the same question from most of my clients. So, I created a step-by-step guide for those who would like to learn how to do it. I know it seems like there are so many steps involved (for a non tech person), but believe me when you get used to it, it just take a few seconds to do it.
Hi, creating anchor seems to be challenging on Ghost. I’ve been creating anchor links in my Ghost posts, but when I publish, unrelated characters and numbers get added to the slug, causing errors. E.g.’
I’ve never added ‘p/bd194660-3e60-43c2-88c8-b2af2f59061b7’ but can’t remove it.
No matter how much I edit the id, it doesn’t seem to fix it. The errors are inconsistent, sometimes happening and sometimes not. What could be causing this? Or should I just avoid using a lot of anchor links in my posts?
I’m not tech-savvy, but really want to fix it in any way!
Thanks in advance for your kind help!