How to disable anchor tags in the home page (but not in an article)
-
Hi, I’m having a small issue with anchor tags. Basically, I run a site with several articles by different authors. On each article I create an anchor tag which I link to the author’s name at the top of the article. So each article will have an intro which says something like:
“In this article, Joe Bloggs discusses the latest developments in Sweden.”
The name “Joe Bloggs” will have an anchor link that when clicked will take users to the bottom of the page (where I have a brief bio for the author): “Joe Bloggs is a Professor of complicated Swedish things” etc.
Now the link I am using is just “#Author” and that works if the user is reading the article and clicks on the link. However, on my home page there are all of the recent articles listed with only the first few paragraphs. When someone clicks on the author’s name direct from the homepage it doesn’t work because the user isn’t actually “in” the article yet, they’re just clicking it from the homepage.
One way around this is to use a direct link to the article in the anchor link: e.g. to make each link “www.mysite.com/article1#Author” rather than just “#Author” but the problem with this is that it creates a serious lag when you click on the anchor link within an article. Instead of going straight to the bottom of the page it takes an extra 2-3 seconds because it has to manually go to the url first before it redirects to the anchor tag.
Is there any way to disable anchor tag links when they’re clicked from the homepage, but still to have them available when a reader is in the actual article?
- The topic ‘How to disable anchor tags in the home page (but not in an article)’ is closed to new replies.