- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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/
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?
I don’t really like using the list item tag when i am making a menu.
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.
ok, thank you.