Home Forums WP Nav Plus Installation and Configuration Adding schema / attributes

This topic contains 1 reply, has 2 voices, and was last updated by  Matt Keys 2 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7124 Reply

    Ben

    Hi Matt,

    Just wondering if there’s a way of adding some schema / attributes to the menus that are generated. For example I can get it to produce

    <nav class="nav-primary">

    But for SEO and accessibility purposes I’d ideally like it to be something like

    <nav class="nav-primary" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement" >

    Thanks,

    Ben

    #7155 Reply

    Matt Keys
    Keymaster

    Hey Ben,

    That sort of change could be done using a WordPress menu walker http://codex.wordpress.org/Class_Reference/Walker

    You could also look into if the items_wrap argument of wp_nav_menu will do what you need: http://codex.wordpress.org/Function_Reference/wp_nav_menu

    Thanks,

    Matt

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Adding schema / attributes
Your information: