Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Custom wp_nav_menu walker WordPress

  • REFUNDED

Hi pals!

Please help me to write custom wp_nav_menu walker to get this html code http://appsolutions.ru/html/menu.html

Or if you can do the same menu view with another html/css - you welcome

Thanks
Roman

Answers (5)

2011-09-03

Andrew Wong answers:

Do you mean you want a menu like that using wp_nav_menu? May I know the theme?


dr_killpatient comments:

There is no theme - I'm trying to make a WP-theme from html. And yes, I hope to made that menu using wp_nav_menu.


Andrew Wong comments:

Checked you code, it is something like this:


<ul class="b-menu-list nm">
<li class="b-menu-link"><a href="#">...</a></li>
...
</ul>



Try to add a DIV for the UL:


<div class="top-menu">
<ul class="b-menu-list nm">
<li class="b-menu-link"><a href="#">...</a></li>
...
</ul>
</div>


Because wp_nav_menu will create itself or the UL class will be different than your manually coded.

Then, you can try to do like this:

// IF MENU FUNCTION EXIST
<?php if (function_exists('wp_nav_menu') ) { wp_nav_menu('theme_location=top_menu&container_class=top-menu'); } else { ?>
// IF FUNCTION NOT EXIST
<div class="top-menu">
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>
</div>
<?php } ?>


dr_killpatient comments:

wp_list_pages can't help coz menu will consist of both pages and categories.


Andrew Wong comments:

dr_killpatient, that is when there is no wp_nav_menu support for backward support (WP version below 3.0 don't have wp_nav_menu support), it will return to list pages, the default menu. If you don't want to see that, you can go with:

<?php if (function_exists('wp_nav_menu') ) { wp_nav_menu('theme_location=top_menu&container_class=top-menu'); } ?>

But if one with lower version of WordPress, it will not show anything at all.


dr_killpatient comments:

Andrew, I'm under latest WP.

I'm already trying to use different menus for the top menu and each sub-menus. But this time I can't find top level parent.

2011-09-03

paul de wouters answers:

if you can use a plugin, you could customize one of these:
http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress-plugin-jquery-drop-down-mega-menu-widget/
http://wpmegamenu.com/

2011-09-03

designchemical answers:

If you cant install the Design Chemical wordpress mega menu version then just apply the jquery plugin version to the standard wp_nav_menu output - this is basically what the mega menu plugin does.

The jquery plugin will take a standard nested html list and generate the mega menu structure you require

<a href="http://www.designchemical.com/lab/jquery-mega-drop-down-menu-plugin/getting-started/">http://www.designchemical.com/lab/jquery-mega-drop-down-menu-plugin/getting-started/</a>

2011-09-03

Pixel Coder answers:

This may be of use to you Roman,

http://wpquestions.com/question/show/id/2880

2011-09-04

ej_emman answers:

Maybe your best reference is this:

[[LINK href="null"]]http://codex.wordpress.org/Function_Reference/wp_nav_menu[[/LINK]]

it was properly explained for beginner and for anyone using custom theme.

you can pm at skype or gtalk if you want for more explaination.