• Resolved outrospective

    (@outrospective)


    Hi. First of all I absolutely love the plugin. Excellent work. I’m only wondering if I can add the itemprop attribute ‘url’ to your menu using funcions.php? On my standard menu it worked using the following function:

    function add_menu_attributes( $atts, $item, $args ) {
    $atts[‘itemprop’] = ‘url’;
    return $atts;
    }
    add_filter( ‘nav_menu_link_attributes’, ‘add_menu_attributes’, 10, 3 );

    This unfortunately does not work anymore with the megamenu

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi outrospective,

    Glad you like the plugin 🙂

    We have all the same filters as the core WordPress menu walker, they are just prepended with “megamenu_”. In your code, try changing:

    nav_menu_link_attributes

    to

    megamenu_nav_menu_link_attributes

    Regards,
    Tom

    Thread Starter outrospective

    (@outrospective)

    Thanks a lot Tom. It worked 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘itemprop attribute’ is closed to new replies.