[Support request] Links within SVG in header

Home Forums Support [Support request] Links within SVG in header

Home Forums Support Links within SVG in header

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #934560
    Kristy

    Hi there. I’ve created an SVG that has an anchor link in it. When I view it in the browser on its own, say from the media library, it works. But when I add it to a header element as an embedded object, the link doesn’t work. Can you let me know if it’s possible to get the link to work within a header element or if there is something I’m doing wrong? The link is the arrow down within the image.

    #934803
    David
    Staff
    Customer Support

    Hi there,

    Does the SVG links work if that content is added in the page content?
    Then we can eliminate whether there is an issue with the SVG or the hero wrapper.

    #934835
    Kristy

    Yes that works actually. So i can remove the header element and use an html block to embed the svg and the link works. The smooth scroll, however, doesn’t work. Do you think that it’s possible to to get that working?

    #934841
    David
    Staff
    Customer Support

    So – the link for smooth scroll must be just an on page link – so instead of heres_my_url/#link its just #link

    #934845
    Kristy

    The only problem with that is that if i remove the first part and just use #link, then it adds #link to the end of the address of the svg and not the page. So it sends the link to /wp-content/../../… .svg#link

    which takes you away from the page. I feel like we are close though!

    #935106
    David
    Staff
    Customer Support

    So this came up before here – and the user provided some feedback on using another plugin:

    https://generatepress.com/forums/topic/using-smooth-scroll-for-a-link-inside-svg/#post-910589

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.