• Hi all

    I did a PageSpeed test and it looks like there are some problems with my wordpress page.

    One of the recommendations says that “Elements with visible text labels do not have matching accessible names”.

    Here’s my screenshot

    I do understand what it means but I don’t know how to change my html code. I tried to change the text label to “More on” and it worked, but what I want to do is to leave the text label as it is now and change the html code to match the text label.

    Where can I fix my html code to fix this problem?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there,

    your aria-label text is not the default for GeneratePress.
    Which means you have some code on your site that is changing that.
    Look in your PHP Snippets / Child Theme for any code related to the Read More

    Thread Starter 9ring

    (@9ring)

    There is no code other than some comments in my Child Theme.

    And I don’t know where my PHP Snippets is.. where can I find it?

    And it’s not that I have to change the parent theme right?

    There are three correct ways of adding PHP Snippets to a site:

    1. in your Child Theme functions.php
    2. in a custom made plugin
    3. using a plugin like Code Snippets

    If the theme functions.php has no codes. Then check in your Plugins to see if you have plugins that allow to to add snippets

    Thread Starter 9ring

    (@9ring)

    1. I don’t have any codes in the Child Theme functions.php
    2. I don’t have any plugins that allow to add snippets.
    3. I’m trying to solve this problem without using plugin.

    Any ideas?

    Perhaps the problem is that this theme still isn’t fully translated to Korean ( #ko_KR ). No language pack has been generated yet, that will happen when at least 90% of the strings have been translated (and approved).

    I mentioned the locale tag here to trigger a notification about this topic to the locale team.

    Ok, try adding this PHP Snipper to your site:

    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</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( 'Read more  on %s', 'more on post title', 'generatepress' ),
    	       the_title_attribute( 'echo=0' )
           )
    	);
    } );
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Elements with visible text labels do not have matching accessible names.’ is closed to new replies.