Wordpress custom menu


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



Copy this code and paste it in your HTML
  1. Add to functions.php:
  2.  
  3. add_action('init', 'my_custom_menu');
  4.  
  5. function my_custom_menu() {
  6. register_nav_menu('my_menu', ('My Menu'));
  7. }
  8.  
  9. Add to your template:
  10.  
  11. <?php wp_nav_menu(array('menu' => 'my_menu')); ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.