[theme-reviewers] custom menus

Edward Caissie edward.caissie at gmail.com
Fri Aug 13 15:53:17 UTC 2010


Yulian -

Have a look at the codex page:
http://codex.wordpress.org/Function_Reference/wp_nav_menu

Try a custom 'fallback_cb' that includes the `<ul>` element you need, for
example:

function my_wp_list_categories() {
>   ?><ul><?php wp_list_categories(); ?></ul><?php
> }
>

Of course, you will likely need to write the CSS specific to your theme
still to utilize both the custom menu and the fallback wp_list_categories,
but this could help ...

Quickly tested using this: <?php wp_nav_menu( array( 'container_class' =>
'menu-header', 'theme_location' => 'primary', 'fallback_cb' =>
'my_wp_list_categories' ) ); ?>

... in Twenty Ten.


Cais.

On Fri, Aug 13, 2010 at 7:37 AM, yulian yordanov <yul.yordanov at gmail.com>wrote:

> Hi,
>
> I know that custom menu is a must-have function in the themes already.
> But not all menus are supposed to be customizable aren't they?
>
> In my case I have two menus - Pages and Categories. Dealing with Pages
> was easy but  Categories did not liked custom menus :)
> What I mean: The old-fashioned way - (wp_list_categories) produces
> only plain list <li>, and in order to make it looks like menu i have
> to enclose <?php wp_list_categories(); ?>  with <div><ul>. When I
> apply wp_nav_menu() it has another, own <ul> which is there by default
> and brakes defined list format. If I leave only wp_nav_menu() without
> enclosures I can't use callback (wp_list_categories) because as I said
> it prints just <li>.
>
> As a whole I think these custom menus are useful but underdone yet to
> be included as a must feature.
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20100813/1dac5ff8/attachment.htm>


More information about the theme-reviewers mailing list