harmus
Forum Replies Created
-
Forum: Themes and Templates
In reply to: add submenu/ subnavigation to WordPress themePut
$subMenuArray = array();in your functions.php and add use this walker:It’ll get your submenu’s in an array ($subMenuArray), ordered by the id of the parent item.
Forum: Themes and Templates
In reply to: wp_nav_menu remove classes from liThere it is. Most of the code comes from WP’s source. This must be the best solution.
Forum: Themes and Templates
In reply to: wp_nav_menu remove classes from liThank you man, I should have looked at that earlier.
I’ll rewrite it as a walker and post that.Forum: Themes and Templates
In reply to: wp_nav_menu remove classes from liYou can write a callback function to output whatever you want.
Thanks for the tip, I hadn’t thought about that. How does one do that? If it’s like an option (instead of forcing/molding it after it has already been generated) I’d be glad to do it that way.
Every byte counts.
Forum: Themes and Templates
In reply to: wp_nav_menu remove classes from liBecause it takes bytes. It should be optional. If one only adds pages to the menu, there’s no need to specify the type. Also a class like ‘menu-item’ is not needed because
.menu LIdoes the same.Another thing I don’t understand is why the id (menu-item-#ID) is added as a class, while it’s already available as an ID-attribute. If anyone knows a quick way to remove that it’d be nice.
Here’s the function for removing those classes (put it in functions.php)
It keeps everything with a number, so the menu-item-#ID class stays. I’d like to remove that as well.
Forum: Themes and Templates
In reply to: wp_nav_menu remove classes from liYou probably want to keep the menu’s itemID’s and current-page-item indicators.
So I rewrote it, becoming this:
[Code moderated as per the Forum Rules. Please use the pastebin]
It would be much better telling WordPress not to add the classes (instead of removing them afterwards), but I don’t know if that’s possible.
Forum: Themes and Templates
In reply to: wp_nav_menu remove classes from li