[Resolved] The Problem of Anchor Links in WordPress

Home Forums Support [Resolved] The Problem of Anchor Links in WordPress

Home Forums Support The Problem of Anchor Links in WordPress

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1537153
    Paul

    Hi how are you?

    Anchor links are used in the table of content sections.
    When I click any one from the table of content, it will be more space when moving the corresponding heading?

    may I know what problem there? how to fix that?

    please check my link from the private information

    thanks in advance

    #1537231
    David
    Staff
    Customer Support

    Hi there,

    you can enable the Smooth Scroll option in the Customizer > General – see here for more info about adding classes to your links:

    https://docs.generatepress.com/article/smooth-scroll/

    This will offset the height of the sticky navigation for the scroll position.

    If want you can apply smoothscroll to all links by simply adding the PHP Snippet provided here:

    https://docs.generatepress.com/article/generate_smooth_scroll_elements/

    #1537263
    Paul

    hi david,

    thanks for your reply and help.

    i tried the first option, and it is useful and solved. but i need to add {class=”smooth-scroll”}one by one manually.

    so,

    i think the second option is better way. just add PHP Snippet one time, then can solve all.

    I’m sorry that i dont know how to add PHP Snippet because i dont know PHP, can you give me the steps or simple guides here?

    Thanks in advance.

    #1537270
    David
    Staff
    Customer Support

    No problems.
    You will need to keep the Customizer > General > Smooth Scroll Enabled.

    Now you have two options:

    1. If you’re using a Child Theme then paste the PHP Snippet into your Child Themes > functions.php.

    2. No Child Theme – then install the Code Snippets plugin and create a new snippet to add the code.

    More detail provided here:

    https://docs.generatepress.com/article/adding-php/

    #1537309
    Paul

    hi David
    thanks for your quick response and helps

    I installed GeneratePress free + Generatepress Premium theme,(https://prnt.sc/vm3gpo) it has the Child Theme?

    I don’t find the Child Theme from Generatepress Theme.

    If Generatepress has Child Theme, can you show me the link of Child Theme?

    Sorry to send you the troubles

    best regards

    #1537429
    David
    Staff
    Customer Support

    This article explains how to add a child theme, and provides a link to the blank child theme:

    https://docs.generatepress.com/article/using-child-theme/

    #1537439
    Paul

    hi david

    thanks for your reply.

    i think i dont need child theme. because my website is ready based on the GP Premium (https://generatepress.com/premium/)

    when i bought the generate theme, dont talk about the child theme.

    If possible, please help me to check my website link from private info, it has child theme?

    I’m sorry that I’m not good at this theme checking.

    so i can directly install the PHP Snippet plugin and add the PHP.

    best regards\

    #1537470
    David
    Staff
    Customer Support

    Maybe just install the Code Snippets plugin ?
    Its far simpler than messing with Child Themes.

    #1537493
    Paul

    hi david
    thanks for all
    good day for you

    #1537497
    David
    Staff
    Customer Support

    You’re welcome

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