This is what I am upgrading Desk Mess Mirrored to:<br><br> // Add wp_nav_menu() custom menu support<br> add_theme_support( 'menus' );<br> function dmm_nav_menu() {<br> if ( function_exists( 'wp_nav_menu' ) )<br>
wp_nav_menu( array(<br> 'theme_location' => 'top-menu',<br> 'depth' => 1,<br> 'fallback_cb' => 'dmm_list_pages'<br>
) );<br> else<br> dmm_list_pages(); <br> }<br> <br> function dmm_list_pages() {<br> if ( is_home() || is_front_page()) {<br> wp_list_pages( 'title_li=&depth=1' );<br>
} else { ?><br> <li><a href="<?php bloginfo( 'url' ); ?>"><?php _e( 'Home', 'desk-mess-mirrored' ) ?></a></li><br> <?php wp_list_pages( 'title_li=&depth=1' );<br>
}<br> }<br> <br> add_action( 'init', 'register_dmm_menu' );<br> function register_dmm_menu() {<br> register_nav_menu( 'top-menu', __( 'Top Menu' ) );<br> }<br> // wp_nav_menu() end<br>
<br>----<br>It's not 100% tested but it should cover the use of wp_nav_menu function well enough. Of course, this is a simple use of wp_list_pages but I am sure it is easily made more robust by editing the function called by 'fallback_cb'. I could have dropped the entire old code section that I was using with wp_list_pages into the dmm_list_pages function but I chose to simplify a bit when implementing wp_nav_menu.<br>
<br><br>Cais.<br><br><br><div class="gmail_quote">On Fri, Jul 16, 2010 at 8:32 PM, Chip Bennett <span dir="ltr"><<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
My primary issue with making use of nav_menu() mandatory for navigation menus<br>
is that the function is nowhere near feature-parity with wp_list_pages(),<br>
especially with respect to automatic child-page navigation and dynamic update<br>
of menu_order and changing page hierarchy.<br>
<br>
For a primarily page-driven website, nav_menu() is still currently a *major*<br>
step backward from wp_list_pages().<br>
<br>
However, I do want to ensure that I'm supporting current functionality as<br>
fully as possible. So, I wrapped my nav_menu() call in a has_nav_menu()<br>
conditional, with an else that has my original wp_list_pages() call. That way,<br>
the user can use the default, very powerful wp_list_pages() call, or else can<br>
build his own menu using nav_menu() if he so chooses.<br>
<br>
Just thought I'd throw that out there to anyone looking for a gracefully<br>
degrading (upgrading?) method of incorporating nav_menu().<br>
<font color="#888888"><br>
--<br>
</font><div class="im">Chip Bennett<br>
<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a><br>
<a href="http://www.chipbennett.net" target="_blank">www.chipbennett.net</a><br>
<br>
</div><div><div></div><div class="h5">On Friday 16 July 2010 11:01:22 am Lance Willett wrote:<br>
> On Thu, Jul 15, 2010 at 6:33 PM, Edward Caissie<br>
><br>
> <<a href="mailto:edward.caissie@gmail.com">edward.caissie@gmail.com</a>> wrote:<br>
> > If our options are: require, recommended, or optional ... I would lean<br>
> > heavily towards optional.<br>
> ><br>
> > If suggested (as noted below) is an available option I would be fine with<br>
> > that designation.<br>
><br>
> I think the best course of action is to strongly suggest supporting<br>
> all customization features, with one custom menu being required (main<br>
> navigation).<br>
><br>
> So something like this:<br>
><br>
> Themes must support the the following customization feature:<br>
><br>
> Navigation Menu - wp_nav_menu()<br>
> * At least one custom menu should be supported, generally the<br>
> top-level navigation.<br>
><br>
> Themes are strongly suggested to support the following customization<br>
> features:<br>
><br>
> Custom Header - add_custom_image_header<br>
> Custom Background - add_custom_background<br>
> Visual Editor CSS - add_editor_style<br>
><br>
> 3.0 changes like comment_form() are required since it isn't an<br>
> optional customization, it's a core part of how themes work.<br>
><br>
> -Lance<br>
> _______________________________________________<br>
> theme-reviewers mailing list<br>
> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</div></div><br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br>