Support » Theme: GeneratePress » Links do not have descriptive text

Viewing 12 replies - 1 through 12 (of 12 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    Which links are these? The main headings? If so, the text itself is descriptive.

    I just ran lighthouse on your home page and I’m seeing this: https://www.screencast.com/t/yhbZ265E2c1

    Thread Starter Marius84

    (@marius84)

    Hello @edge22 is the links on homepage. The lighthouse can’t read anymore the text “Read More” You miss to add the SEO button to see the error https://prnt.sc/uue7in

    Theme Author Tom

    (@edge22)

    Strange, the link has a title attribute and an aria-label attribute for screen readers: https://www.screencast.com/t/VXhLrXZDoWE8

    It used to have a screen reader text element inside of it, but the aria-label replaces that and means we don’t need to hide text.

    Thread Starter Marius84

    (@marius84)

    So it’s ok right now for SEO ? I don’t have this error on lighthouse with the old GP 2.2.4

    GP 3.0 Rocks! 🙂

    • This reply was modified 1 year, 7 months ago by Marius84.
    Theme Author Tom

    (@edge22)

    I’ll have to research a bit – I’m surprised that they would require actual text instead of the title attribute.

    Thanks! Very happy with it.

    Thread Starter Marius84

    (@marius84)

    Thank you @edge22 Let me know if you find something! I used to see 100% SEO with google lighthouse, now 92% with GP 3.0

    Wish you an awesome day!

    • This reply was modified 1 year, 7 months ago by Marius84.
    Thread Starter Marius84

    (@marius84)

    in the meantime is there interim solution I can apply to fix this?

    Theme Author Tom

    (@edge22)

    You can make the text more descriptive:

    add_filter( 'generate_excerpt_more_output', function() {
        return sprintf(
            ' ... <a title="%1$s" class="read-more" href="%2$s" aria-label="%4$s">%3$s about %5$s</a>',
            the_title_attribute( 'echo=0' ),
            esc_url( get_permalink( get_the_ID() ) ),
            __( 'Read more', 'generatepress' ),
            sprintf(
                /* translators: Aria-label describing the read more button */
                _x( 'More on %s', 'more on post title', 'generatepress' ),
                the_title_attribute( 'echo=0' )
            ),
            get_the_title()
        );
    } );
    Thread Starter Marius84

    (@marius84)

    Thank you @edge22 is perfectly working!

    Theme Author Tom

    (@edge22)

    You’re welcome 🙂

    Hi Tom,

    where should i have to add this code

    add_filter( ‘generate_excerpt_more_output’, function() {
    return sprintf(
    ‘ … %3$s about %5$s‘,
    the_title_attribute( ‘echo=0’ ),
    esc_url( get_permalink( get_the_ID() ) ),
    __( ‘Read more’, ‘generatepress’ ),
    sprintf(
    /* translators: Aria-label describing the read more button */
    _x( ‘More on %s’, ‘more on post title’, ‘generatepress’ ),
    the_title_attribute( ‘echo=0’ )
    ),
    get_the_title()
    );
    } );

    Hi there,

    that code is PHP, this article explains how to add it to your site:

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Links do not have descriptive text’ is closed to new replies.