WordPress.org

Ready to get started?Download WordPress

Forums

Clean HTML Only Optional CSS Allowed. (7 posts)

  1. Adil
    Member
    Posted 1 year ago #

    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.

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    What do you have at the moment?

  3. Adil
    Member
    Posted 1 year ago #

    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>
  4. Adil
    Member
    Posted 1 year ago #

    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/

  5. Andrew
    Forum Moderator
    Posted 1 year ago #

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

    Do you have this option already?

  6. Adil
    Member
    Posted 1 year ago #

    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.

  7. Adil
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic