wordpress_add

Monday 9 September 2013

HOw to Add custom menu in word press..

Locate Function.php and paste this code in it.


function register_my_menus() {
register_nav_menus(
array(
'left-menu' => __( 'Left Menu' ),
'home-menu' => __( 'Home Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );


//Paste this code on any page or template...



 <?php wp_nav_menu( array( 'theme_location' => 'left-menu' )); ?>


Here is the code for default menu.Remember don't do styling of <ul>  Make a <div> outside to it and style that div.

example: .div ul {   }

 <?php wp_nav_menu( array( 'theme_location' => 'primary' )); ?>



Subscribe us for Important Knowledge of word press.Your's suggestions are most welcomed..

1 comment:

  1. Exactly needed The same implementation..:)

    ReplyDelete