WordPress enable custom menus


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /* support custom menus */
  2. add_action( 'init', 'register_my_menus' );
  3. function register_my_menus() {
  4. register_nav_menus(
  5. array(
  6. 'menu-nav' => __( 'Navigation Menu' )
  7. // ,
  8. //'menu-2' => __( 'Footer Menu' )
  9. )
  10. );
  11. }
  12.  
  13. // then in header.php add:
  14.  
  15. <?php wp_nav_menu( array( 'theme_location' => 'menu-nav' ) ); ?>

URL: http://www.devlounge.net/code/how-to-add-support-for-menus-in-your-wordpress-theme

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.