Friday, 15 June 2012

How to allow my theme to support multiple menus in wordpress -



How to allow my theme to support multiple menus in wordpress -

i developing site in wordpress. using theme named moesia. while customizing the theme according website needs, found theme supports 1 menu main menu @ top right.

i want add together menu visible within page. have tried add together custom menu page, issue when click on menu item whole page refreshes , menu goes away. want menu remain on page , click on menu item should display content adjacent menu.

i absolutely new technology.

how can accomplish this?

add next functions.php file. 2 menus “primary”, , “secondary” menus.

//register navigations add_action( 'init', 'my_custom_menus' ); function my_custom_menus() { register_nav_menus( array( 'primary-menu' => __( 'primary menu' ), 'secondary-menu' => __( 'secondary menu' ) ) ); }

to add together them site need add together next wordpress template files (most header.php , footer.php files).

<?php wp_nav_menu (array('theme_location' => 'primary-menu','menu_class' => 'nav'));?> <?php wp_nav_menu (array('theme_location' => 'secondary-menu','menu_class' => 'nav'));?>

wordpress

No comments:

Post a Comment