Using Custom Menus in WordPress using PHP


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

How to enable Custom Navigation Menus in WordPress 3.0

Like the custom background, header image, and post thumbnails, the custom navigation menus also needs to be enabled through your theme’s functions.php file.


Copy this code and paste it in your HTML
  1. Simply add the code below to your theme’s functions.php file:
  2.  
  3. add_theme_support( 'menus' );
  4.  
  5.  
  6. And use this code to insert the menu into your template file:
  7.  
  8. <?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>

URL: http://www.wpbeginner.com/wp-themes/how-to-add-custom-navigation-menus-in-wordpress-3-0-themes/

Report this snippet


Comments


You need to login to view comments.