[Resolved] screen-reader-text

Home Forums Support [Resolved] screen-reader-text

Home Forums Support screen-reader-text

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #506139
    chete

    Hello,
    What is it and what does this link do in the code?

    <a class="screen-reader-text skip-link" href="#content" title="Saltar al contenido">Saltar al contenido</a>

    It’s right after the body tag.

    Regards

    #506534
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It’s an element visible to people using screen readers. It’s an accessibility feature which allows them to navigate and use your website easier.

    #509553
    chete

    Hello,

    Ok Tom, thank you so much for responding.

    regards

    #509892
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

    #779822
    chete

    Hi

    A doubt, how can i deactivate that line of code ?

    Regards

    #780051
    Tom
    Lead Developer
    Lead Developer

    If you really have to, you can do this:

    remove_action( 'generate_before_header', 'generate_do_skip_to_content_link', 2 );

    #832632
    chete

    hello

    I’ve added a snippet with the function and it doesn’t remove the code. What other solution could there be ?

    Regards

    #833092
    Tom
    Lead Developer
    Lead Developer

    How did you add the code?

    #833096
    chete

    Hi Tom

    with the Code Snippets plugin

    Regards

    #833378
    Tom
    Lead Developer
    Lead Developer

    Try this instead:

    add_action( 'after_setup_theme', function() {
        remove_action( 'generate_before_header', 'generate_do_skip_to_content_link', 2 );
    }, 50 );

    Let me know πŸ™‚

    #833525
    chete

    Okay, perfect. It works.

    Thanks !

    #833935
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

    #1063140
    Hilton

    Hi Tom,

    It seems that hiding text and links is a practice outside the Webmaster Quality Guidelines, as stated in the following URL: https://support.google.com/webmasters/answer/66353?hl

    This way, how can I also remove these codes from pages:

    <li class="search-item" title="Pesquisar"><a href="#"><span class="screen-reader-text">Pesquisar</span></a></li>

    <div class="mobile-bar-items">
    <span class="search-item" title="Pesquisar">
    <a href="#">
    <span class="screen-reader-text">Pesquisar</span>
    </a>
    </span>
    </div>

    Thanks

    #1063532
    Tom
    Lead Developer
    Lead Developer

    When it comes to Google, you don’t need to worry about the screen reader text: https://www.searchenginejournal.com/google-using-hidden-text-for-screen-readers-will-not-hurt-rankings/294605/

    #1064199
    Hilton

    Ok Tom, thanks for the explanation.

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