Title: Clean HTML Only Optional CSS Allowed.
Last modified: August 20, 2016

---

# Clean HTML Only Optional CSS Allowed.

 *  [Adil Farooq](https://wordpress.org/support/users/adilfarooq/)
 * (@adilfarooq)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/clean-html-only-optional-css-allowed/)
 * 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](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 5 months ago](https://wordpress.org/support/topic/clean-html-only-optional-css-allowed/#post-3284224)
 * What do you have at the moment?
 *  Thread Starter [Adil Farooq](https://wordpress.org/support/users/adilfarooq/)
 * (@adilfarooq)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/clean-html-only-optional-css-allowed/#post-3284228)
 * 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](https://wordpress.org/support/users/adilfarooq/)
 * (@adilfarooq)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/clean-html-only-optional-css-allowed/#post-3284231)
 * 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/](http://mattvarone.com/wordpress/cleaner-output-for-wp_nav_menu/)
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 5 months ago](https://wordpress.org/support/topic/clean-html-only-optional-css-allowed/#post-3284233)
 * >  //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](https://wordpress.org/support/users/adilfarooq/)
 * (@adilfarooq)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/clean-html-only-optional-css-allowed/#post-3284240)
 * 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](https://wordpress.org/support/users/adilfarooq/)
 * (@adilfarooq)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/clean-html-only-optional-css-allowed/#post-3284241)
 * 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](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.

## Tags

 * [Walker](https://wordpress.org/support/topic-tag/walker/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Adil Farooq](https://wordpress.org/support/users/adilfarooq/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/clean-html-only-optional-css-allowed/#post-3284241)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
