June 21, 201214 yr Is anyone familiar with jquery lavalamp? Trying to call the lavalamp function, but instead of passing a ul list to it, would like to be able to use a wordpress nav menu. The point is to make a more user friendly theme with the ability to adjust the menu from the wp admin interface for menus, rather than programatically changing the ul list... $(function() { $("#mainMenu ul").lavaLamp({ fx: "backout", speed: 700, click: function(event, menuItem) { return true; }
June 21, 201214 yr As a WordPress menu outputs an unordered list, I can't really see where your problem is.
June 21, 201214 yr Author As a WordPress menu outputs an unordered list, I can't really see where your problem is. Here is what I've attempted: <ul class="lavaLamp"> <?php if (is_home()) { $addclass = ' class="current"'; } else { $addclass = ''; } echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>"; /*echo listPages();*/ echo wp_nav_menu(array('theme_location'=>'primary-menu')); ?> </ul> Seems to work fine using echo listPages(); , but I want to use the custom nav menu instead of just belching out every page to the menu. The echo wp_nav_menu(array('theme_location'=>'primary-menu')); doesn't work, the menu only displays 'Home'.
June 21, 201214 yr That's because you're not using wp_nav_menu right. Just call it, don't echo it. Also, strip out the hard-coded "home" link and use a home link in the menu itself.
June 22, 201214 yr Author That's because you're not using wp_nav_menu right. Just call it, don't echo it. Also, strip out the hard-coded "home" link and use a home link in the menu itself. Thanks, but your suggestions weren't what I was looking for. I was hoping to find, as I stated originally, someone familiar with both WP and jquery lavaLamp. Turns out you have to create a custom walker to strip the li info from the wp_nav_menu in order to pass it off properly to the lavaLamp function.
Create an account or sign in to comment