Advertisement
fauzanjeg

Custom Menu || Custom Change

May 24th, 2021
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. /** Custom Menu */
  2. function custom_navigation() {
  3.     $menu_class = array( 'jeg_menu', 'jeg_main_menu', 'jeg_custom_menu' );
  4.  
  5.     $menu_class[] = get_theme_mod( 'jnews_header_menu_style', 'jeg_menu_style_1' );
  6.  
  7.     add_filter( 'pre_wp_nav_menu', array( \JNews\Menu\Menu::getInstance(), 'jeg_pre_wp_nav_menu' ), null, 2 );
  8.  
  9.     wp_nav_menu(
  10.         array(
  11.             'theme_location'  => 'custom_navigation',
  12.             'container_class' => 'jeg_nav_item jeg_mainmenu_wrap',
  13.             'menu_class'      => implode( ' ', $menu_class ),
  14.             'depth'           => 0,
  15.             'items_wrap'     => '<ul class="%2$s">%3$s</ul>',
  16.             'echo'            => true
  17.         )
  18.     );
  19.  
  20.     jnews_remove_filters( 'pre_wp_nav_menu', array( \JNews\Menu\Menu::getInstance(), 'jeg_pre_wp_nav_menu' ), null );
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement