Problems with anchors

  • Unknown's avatar

    Hi
    I have put some anchors in some of my posts and pages to go back to the main page after visiting some other link, but when I press them they don’t go to where I put the anchor (sometimes they do go to the anchor location after I refresh the page several times). Any insights on why this is happening?
    You can try with this post: https://wp.me/pbhUT6-AZ
    Search for the word link and press the link; once you are the other page, go to the bottom of the page and press the link I added to come back to the post. It is hit and miss, sometimes it goes to where the anchor is, sometimes it does not

    WP.com: Yes
    Correct account: Yes

    The blog I need help with is: (visible only to logged in users)

  • Hello there,

    Thanks for reaching out.

    Are you able to tell us where the word link in https://wp.me/pbhUT6-AZ is please as this will help us to see what’s different between the links.

    Many thanks!

  • Unknown's avatar

    I set four anchors; I first put them in the text, but due to the page title banner you could not see the text I went the reader to go to, so at the end, I settled to embed them in the html for the photo right before the text I want the reader to go to. The anchors are in the following places:

    1. id=”cattedrale”
    <!– wp:image {“align”:”center”,”id”:4824,”sizeSlug”:”large”,”linkDestination”:”none”} –>
    <figure class=”wp-block-image aligncenter size-large” id=”cattedrale”></figure>
    <!– /wp:image –>

    2. id=”lorenzo”
    <!– wp:image {“align”:”center”,”id”:4824,”sizeSlug”:”large”,”linkDestination”:”none”} –>
    <figure class=”wp-block-image aligncenter size-large” id=”lorenzo”></figure>
    <!– /wp:image –>

    3. id=”gesu”
    <!– wp:image {“align”:”center”,”id”:4824,”sizeSlug”:”large”,”linkDestination”:”none”} –>
    <figure class=”wp-block-image aligncenter size-large” id=”gesu”></figure>
    <!– /wp:image –>

    4. id=”chiara”
    <!– wp:image {“align”:”center”,”id”:4824,”sizeSlug”:”large”,”linkDestination”:”none”} –>
    <figure class=”wp-block-image aligncenter size-large” id=”chiara”></figure>
    <!– /wp:image –>

  • Unknown's avatar

    Quick update: I forgot to mention, I tried on Safari (worst, in general), Firefox and Chrome.
    It is not reproducible all the time. This morning I tried them both and I got 1 misplaced return to anchor on Chrome. Firefox was working fine. Could it be some loading problem? Usually, when it fails, I am either sent to the top of the post, or a place that is higher up from where the anchor is.
    Weird.
    Thanks!

  • Hello there,

    Ok, so just to double check..

    On this post: https://elizabethricardotravels135819509.wordpress.com/2022/09/04/napoli-1-2/ the text:

    Here is a link to our visit

    Is meant to link to an image on another post – or an image inside of that post?

    I want to be able to replicate the behaviour you’re experiencing exactly. :)

  • Unknown's avatar

    Thanks for following up.
    Basically, the Here is a link to our visit takes you to another page (usually inside of museums, old churches, etc.); at the end of this “receiving page” I have a text similar to “Follow this link to go back to the Napoli itinerary” (or similar). For this last link, I link to the original post ( https://elizabethricardotravels135819509.wordpress.com/2022/09/04/napoli-1-2/) plus the anchor
    For example:

    Napoli (1/2)

    This should take me to the place where I put the anchor, but it does not work all the time (as I mentioned, it seems worst in Safari and better in Firefox, Chrome might or might not work). I have been copy and paste the address above (with the anchor) and sometimes it seems to randomly taking me to a place in the post
    Hope this explains it

  • Hi there,

    One thing I noticed when viewing this post for the first time using your anchor link, is that there is quite a few images… so many in fact that even though I land in the correct place for the anchor, I can see that images (both above and below the current anchor point) take their time to load. The net effect of this is that images that are still loading my push the page further down so the anchor scrolls out of view.

    It happens pretty fast (just the blink of an eye when I visit) but I can see the anchor link fall out of view as images load. I suspect this is at the root of the issue, as your post has 107 very lovely (!) but also very large and “hi-res” images on it. All things being equal, a page with that many images is slower to load than one with a more reasonable amount of images.

    Are you able to set up a test page with just a few images (say 20 or so) and a few anchor links? If so does that page have the same issue or does it land on a different point than the anchor link?

    In my experience jump links (link anchors) work great if the page is lightweight and mostly text-based, but on a page that is slow to load like this, jump links are less effective due to the image loading issue I mentioned. Also worth noting that different browsers handle image loading in different ways. It makes sense that you would have different results in Firefox vs. Safari (for example) due to this.

  • Unknown's avatar

    Thanks! I think you are absolutely right!
    One question: is there a setting in WordPress to “downgrade” the images so the pages load faster?
    Thanks!

  • Hi there, we do not currently have a built-in option to bulk downgrade photos.

    If you have a Business Plan, and can therefore install plugins, there are a few options available: https://wordpress.org/plugins/search/optimize+images/

  • The topic ‘Problems with anchors’ is closed to new replies.