How Do I Make a Static Menu Bar in WordPress?
Static menus are a great way to keep your WordPress site looking clean and organized. You can create a static menu by adding a few lines of code to your theme’s functions.
php file. Here’s what you need to do:.
1. Add the following line to your functions.php file:
add_action(‘admin_menu’, ‘static_menu’);
2. Add a div to your theme’s header section that will hold your menu:
3. Add the following code to your static-menu-header div:
‘#static-menu-header’, ‘menu_class’ => ‘static-menu’, ‘container_class’ => ‘menu-item’, ‘depth’ => 3, ‘items_per_page’ => 20, ‘menu_title’ => __(‘Menu Title’), ‘submenu_title’ => __(‘Submenu Title’), ‘items’ => array(), ‘has_submenu’ => true, ‘submenu_items’ => array(), ‘submenu_title’ => __(‘Submenu Title’), ‘depth_submenu’ => 1, ‘font_size’ => ’12px’, ‘font_family’ => ‘Arial’, ‘link_Target’ => ‘_self’, ‘link_rel’ => ‘alternate’, ‘back_link’ => ‘/’, ‘front_link’ => ‘home’, ‘admin_bar’ => true, ‘footer_on_pages’ => true, ‘admin_bar_style’ => ‘default’, ‘menu_order’ => ‘1’, ‘posts_per_page’ => 20, ‘has_posts’ => true, ‘post_type’ => ‘page’, ‘menu_orderby’ => ‘menu_order’, ‘posts_per_menu’ => false, ‘post_type_name’ => ‘page’, ‘taxonomy’ => ‘category’, ‘has_taxonomy’ => true, ‘taxonomy_name’ => ‘category’, ‘hierarchical’ => false, ‘menu_icon’ => ‘menu-item-add’, ‘position’ => ‘2’, ‘menu_class’ => ”, ‘menu_item_type’ => ‘previous’, ‘menu_item_id’ => ”, ‘item_name’ => ‘Item Name’, ‘item_id’ => ”, ‘parent_item_id’ => null, ‘menu_order’ => ‘2’, ‘meta_title’ => __(‘Menu Title (Alt)’), ‘meta_description’ => __(‘Description’), ‘meta_keywords’ => __(‘Keywords’), ‘meta_title_for_layout’ => __(‘Menu Title (Alt)’) ), ‘has_children’ => false, ‘depth_1′ => 0, ‘depth_2′ => 0, ‘depth_3′ => 0, ‘children’ => array(), ‘has_submenu’ => true, ‘submenu_items’ => array(), ‘submenu_title’ => __(‘Submenu Title’), ‘depth_submenu’ => 1, ‘font_size’ => ’12px’, ‘font_family’ => ‘Arial’, ‘link_Target’ => ‘_self’, ‘link_rel’ => ‘alternate’, ‘back_link’ => ‘/’, ‘front_link’ => ‘home’, ‘admin_bar’ => true, ‘footer_on_pages’ => true, ‘admin_bar_style’ => ‘default’, ‘menu_order’ => ‘1’, ‘posts_per_page’ => 20, ‘has_posts’ => true, ‘post_type’ => ‘page’, ‘menu_orderby’ => ‘menu_order’, ‘posts_per_menu’ => false, ‘post_type_name’ => ‘page’, ‘taxonomy’ => ‘category’, ‘has_taxonomy’ => true, ‘taxonomy_name’ => ‘category’, ‘hierarchical’ => false, ‘menu_icon’ => ‘menu-item-add’, ‘position’ => ‘2’, ‘menu_class’ => ”, ‘menu_item_type’ => ‘previous’, ‘menu_item_id’ => ”, ‘item_name’ => ‘Item Name’, ‘item_id’ => ”, ‘parent_item_id’ => null, ‘menu_order’ => ‘2’, ‘meta_title’ => __(‘Menu Title (Alt)’), ‘meta_description’ => __(‘Description’), ‘meta_keywords’ => __(‘Keywords’), ‘meta_title_for.