Advertisement
askwpcoach

Creating Dynamic Menu

Aug 27th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. Menu functions.php Code(creating theme locations)
  2. <?
  3. //add dynamic menu
  4. add_action( 'init', 'register_my_menus' );
  5. function register_my_menus() {
  6.     register_nav_menus(
  7.         array(
  8.             'primary-menu' => __( 'Primary Menu' ),
  9.             'secondary-menu' => __( 'Secondary Menu' ),
  10.             'footer-menu' => __( 'Footer Menu' )
  11.         )
  12.     );
  13. }
  14. ?>
  15.  
  16. +++++++++++++++++++++++++++++++
  17. Display menu location in theme
  18. <?php wp_nav_menu(array('theme_location' => 'primary-menu')); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement