wp_nav_menu custom walker class to add li-class for children (1 post)

  1. gerald@WPcustoms
    Posted 4 years ago #

    Hi everybody,

    I extended the wp-nav-menu walker class and need to get a custom class into the children list.
    I assume it must be coded into the start_el function starting at line 67:
    I copied it to my functions.php

    I managed to get the "topnav" added to the parent list but failed with the nested ul subnav list-class.
    it should look like this:

    <ul id="navigation">
    <li><a href="#">Home</a></li>
    <li class="topnav"><a href="#">Subs</a>
       <li class="subnav"><a href="#">Sub-Link 1</a></li>
       <li class="subnav"><a href="#">Sub-Link 2</a></li>

    thanks for every help.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by gerald@WPcustoms
  • This topic is not resolved
  • WordPress version: 3.3.1


No tags yet.