Controlling the position of dropdow submenu
Without seeing the current code, you could try the folllowing: Use padding-top over the <ul> tag and colour the <li> tag’s background colour in the dark grey. This way you avoid using top / margin-top.
Without seeing the current code, you could try the folllowing: Use padding-top over the <ul> tag and colour the <li> tag’s background colour in the dark grey. This way you avoid using top / margin-top.
Problem add submenu page
Notices are render inside sub-menu’s content
Links doesnt appear as a submenu on a mobile
Filter ‘wp_nav_menu_objects’ would help: add_filter( ‘wp_nav_menu_objects’, ‘remove_sub_items’, 10, 2 ); function remove_sub_items( $items,$args ) { $new_items = array(); for ($i=1;$i<count($items)+1;$i++){ //is lvl0 if(empty($items[$i]->menu_item_parent)){ $new_items= array_merge($new_items, nav_tree($items[$i],$items)); } } // var_dump($new_items); die(); if( $args->theme_location == ‘primary’ ) return $new_items; return $items; } function nav_tree($parent,$items){ $rtn = array(); $rtn[] = $parent; //Edit this conditional, return menu level … Read more
Use the action admin_menu as opposed to admin_init. You also need to adjust your use of remove_submenu_page to match the way Newsletter adds menu items: remove_submenu_page( ‘newsletter_main_index’, ‘newsletter_main_index’ ); remove_submenu_page( ‘newsletter_main_index’, ‘newsletter_main_main’ ); remove_submenu_page( ‘newsletter_main_index’, ‘newsletter_main_diagnostic’ ); remove_submenu_page( ‘newsletter_main_index’, ‘newsletter_subscription_profile’ );
I am not sure how the Hestia theme works but normally, you need to create child pages by setting a parent page in your wp-admin Pages menu. Or by going to Appearances > Menu, here you can create custom menus and set them to different locations.
You can try the following function: function wpse_290320_get_page_ids_from_menu( $menu_id, $submenu_id ) { $menus = wp_get_nav_menu_items( $menu_id ); $pages = array(); foreach( $menus as $menu ) { if( $submenu_id == $menu->menu_item_parent && ‘page’ == $menu->object ) { $pages[] = $menu->object_id; } } return $pages; } $menu_id = 26; $submenu_id = 3298; $pages = wpse_290320_get_page_ids_from_menu( $menu_id, $submenu_id … Read more
Define supporting only 1-level menu
Submenu causes issue in defined blog page