• Hello i want to achieve following clean code using custom walker can anybody help me doing so.
    Here is what i want to do

    <nav id="network">
    <ul id="quick-nav">
    <li class="">  //li class only shown when i add it through option css on admins back-end.
    <a class="dd" href="#">Top Stories</a> //if is the top menu then a class will be dd otherwise empty
    <ul class="sub">
    <li>
    <a href="#">Photo</a>
    </li>
    <li>
    <a href="#">Top Lists</a>
    </li>
    </ul>
    </li>
    <li class="o"> // here is the custom class added through back end
    <a class="s" href="#">Name</a>
    </li>
    </ul>
    </nav>

    I want to achieve the above code kindly anybody tell me ho to do it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What do you have at the moment?

    Thread Starter Adil Farooq

    (@adilfarooq)

    At the moment its

    <nav id="network">
    <ul id="quick-nav">
    <li class="current_page_item">
    <a href="#">Top Stories</a>
    <ul class="sub">
    <li class="current_page_item">
    <a href="#">Photo</a>
    </li>
    <li class="current_page_item">
    <a href="#">Top Lists</a>
    </li>
    </ul>
    </li>
    <li class="current_page_item">
    <a href="#">Name</a>
    </li>
    </ul>
    </nav>
    Thread Starter Adil Farooq

    (@adilfarooq)

    I have searched a lot on the internet and found custom walker but when i apply that then the li tag become
    <li class="">
    but when i try to add option css class to it no effect on it.

    I applied the following code shown here

    http://mattvarone.com/wordpress/cleaner-output-for-wp_nav_menu/

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    //li class only shown when i add it through option css on admins back-end.

    Do you have this option already?

    Thread Starter Adil Farooq

    (@adilfarooq)

    Well this option already comes with wordpress we just have to activate it in the MENU> SCREEN OPTIONS> CSS CLASSES
    when we check the box with every item in our menu a box appears where we can add this optional css class.

    Thread Starter Adil Farooq

    (@adilfarooq)

    OR I can tell you simply i want to achieve the Top menu of the following blog.

    http://jobs.mashable.com/a/all-jobs/list

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Clean HTML Only Optional CSS Allowed.’ is closed to new replies.