Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress wp_nav_menu Problem

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #168549
    waydechism5
    Participant

    I using Cris’s post on how to make the wp_nav_meu function just an <a>, and it doesn’t keep the current _page_item. How could i make it keep the current_page_item?

    Reference: https://css-tricks.com/snippets/wordpress/remove-li-elements-from-output-of-wp_nav_menu/

    #168594
    connorblikre
    Participant

    Well the article you linked shows how to remove the <li> tags from the menu, which are the elements that have the current_page_item class. Why do you need to remove the <li> tags?

    #168596
    waydechism5
    Participant

    I don’t really like using the list item tag when i am making a menu.

    #168598
    connorblikre
    Participant

    In that case, maybe a better way to do this would be to extend the Walker class and change the html to use different elements. WordPress adds the special classes to the list items so either you’ll have to change the html structure of the menu or live without special menu classes. Or just use the default.

    Although in my opinion, it’s a lot of work just to avoid using list item tags.

    #168600
    waydechism5
    Participant

    ok, thank you.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.