menus.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /*
  3. * Register All Menus
  4. *
  5. */
  6. function luceo_menus() {
  7. register_nav_menus(
  8. array(
  9. 'header-menu' => __( 'Header menu' , 'nav menu location', 'luceo'),
  10. 'footer-menu' => __( 'Footer menu' , 'nav menu location', 'luceo')
  11. )
  12. );
  13. }
  14. add_action( 'init', 'luceo_menus' );
  15. /*
  16. * Menus Settings
  17. *
  18. */
  19. //Header menu
  20. function luceo_header_menu() {
  21. if ( has_nav_menu( 'header-menu' ) ) {
  22. wp_nav_menu(
  23. array(
  24. 'theme_location' => 'header-menu',
  25. 'menu' => '',
  26. 'container' => 'div',
  27. 'container_id' => 'header-menu-con-id',
  28. 'container_class' => 'header-menu-con-cl',
  29. 'menu_id' => 'header-menu-id',
  30. 'menu_class' => 'header-menu-cl',
  31. 'echo' => true,
  32. 'fallback_cb' => '',
  33. 'before' => '',
  34. 'after' => '',
  35. 'link_before' => '<span>',
  36. 'link_after' => '</span>',
  37. 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
  38. 'depth' => 0,
  39. 'walker' => ''
  40. )
  41. );
  42. }
  43. }
  44. //Fotter menu
  45. function luceo_footer_menu() {
  46. if ( has_nav_menu( 'footer-menu' ) ) {
  47. wp_nav_menu(
  48. array(
  49. 'theme_location' => 'footer-menu',
  50. 'menu' => '',
  51. 'container' => 'div',
  52. 'container_id' => 'footer-menu-id',
  53. 'container_class' => 'footer-menu-cl',
  54. 'menu_id' => 'footer-menu-id',
  55. 'menu_class' => 'footer-menu-cl',
  56. 'echo' => true,
  57. 'fallback_cb' => '',
  58. 'before' => '',
  59. 'after' => '',
  60. 'link_before' => '',
  61. 'link_after' => '',
  62. 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
  63. 'depth' => 0,
  64. 'walker' => ''
  65. )
  66. );
  67. }
  68. }