[Resolved] Offset anchors with fixed header

Home Forums Support [Resolved] Offset anchors with fixed header

Home Forums Support Offset anchors with fixed header

Viewing 15 posts - 16 through 30 (of 58 total)
  • Author
    Posts
  • #190513
    xyz

    <p style="position: relative;"></p>

    Hi Tom,

    The above works beautifully. I found it here – http://stackoverflow.com/questions/17534661/make-anchor-link-go-some-pixels-above-where-its-linked-to
    after completely not being able to work out where to put the
    a.anchor {
    display: block;
    position: relative;
    top: -250px;
    visibility: hidden;
    }

    Happy.

    #190514
    xyz

    <p style="position: relative;"><a id="economics" style="position: absolute; top: -100px;" name="economics"></a></p>

    Happier now I finally figured that bit out as well.

    #190516
    Tom
    Lead Developer
    Lead Developer

    Awesome πŸ™‚

    #190522
    xyz

    Thanks for your perseverance Tom, I appreciate it. I’m enjoying playing in GeneratePress.

    Cheers.

    #190617
    Tom
    Lead Developer
    Lead Developer

    No problem! Glad you’re enjoying it πŸ™‚

    #209388
    Bin

    Hi. Wouldn’t this plugin the easier way to solve the problem (until Tom integrates his own solution! ;))

    https://wordpress.org/plugins/hash-link-scroll-offset/

    Cheers, Bin

    #209412
    Tom
    Lead Developer
    Lead Developer

    Cool plugin, thanks for sharing! πŸ™‚

    #209591
    Bin

    Yes, but unfortunately NOT perfect as i found out last night. If you click an anchor link (absolute link!) from the actual/same page (e.g. a top menu button) it does not work properly. It’s really a pity! The very best option would be: YOU (Dear Tom) integrate a plugin that fits perfectly into GP!!! Maybe there is one on the way already???

    Bye, Bin

    #209635
    Tom
    Lead Developer
    Lead Developer

    I’ll try to get this integrated into the next version, but it might not be until 1.2.89.

    #209642
    Bin

    OK, sounds good.
    By the way, you solved the problem by using the section-ID for the INSTALL-Button on your page:
    https://generatepress.com/install-generatepress/

    But the url “…/#generate-section-2” is not soooo good for SEO! πŸ˜‰

    Is there a way to rename/customize the Section-Name?

    #209821
    Tom
    Lead Developer
    Lead Developer

    I’m afraid not, but you can add an anchor into your section content and link to it:

    <a name="my-seo-friendly-id"><!-- anchor --></a>

    #210009
    Bin

    Thanks Tom,

    but the same issue with scolling down to the h2-Tag inside the section instead of stopping at the section top-border!

    <!– anchor –>

    And it also increases the space above the h2-tagline… :((

    #210083
    Tom
    Lead Developer
    Lead Developer

    Sections is currently being re-written so I’ll see if I can add a new field in there for users to specify a custom ID πŸ™‚

    #210152
    Bin

    Wow, that would be great! Thanks, Bin

    #210324
    Bin

    AND a Section-CTA-Button-Field would even be greater! ;))

Viewing 15 posts - 16 through 30 (of 58 total)
  • You must be logged in to reply to this topic.