Site logo

Archived topic

Lack of element id

9 replies · Started by Longinos on March 22, 2022

Viewing posts 1–10 of 10

Hi
I have searched the forum not found nothing related.
Theme GP and GPP latest versions.
In the search button there is an aria-controls="primary-menu" but no element with primary-menu id is in the page.
I see in this site that the element that contains the id in the main menu but in my uses case the main menu is in the off-canvas
Your site, visible main menu have <div id="primary-menu" class="main-nav">, my site main menu in the off-canvas have
<div class="main-nav">

How I can solve this?

Hi there,

I am getting an Access Denied return on the URL you provided - can you 'unlock' that so I can take a look?

Hi David
I can´t see any 403 in the logs.
And have no recent blocks from fail2ban and not see any access from UK

P.S: Maybe you have Virgin Connection? Have truobles with UK people. Unblocked now.

Ok - so its the menu-toggle, would changing that aria-control to the off canvas menu ID fix it? If so you can try this:

add_filter( 'generate_parse_attr', function( $attributes, $context ) {
    if ( 'menu-toggle' === $context ) {
        $attributes['aria-controls'] = 'generate-slideout-menu';
    }

    return $attributes;
}, 10, 2 );

I David
Tried it but still point to primary-menu.

Try this:

add_action( 'wp',function(){
    add_filter( 'generate_parse_attr', function( $attributes, $context ) {
        if ( 'menu-toggle' === $context ) {
            $attributes['aria-controls'] = 'generate-slideout-menu';
        }
    
        return $attributes;
    }, 10, 2 );
});

Hi David
This worked. I put this in child functions.php as a workaround, but think this must be managed by the theme himself.
Maybe in the next release? =:-))

I have raised it as an issue - I am not sure it will make the next release though.

Hi David

Is a joke... =:-)) , do a 90 deggre turn whit = up and )) down
I know things need time to go out.

:) Its on our list now.

Glad to be of help

This archived topic is closed to new replies.