Hi all,
I had help last week to create an extra menu thank you @Bogdan
With the code. I made simply copy paste and tweaked the code to create 3 menu items underneath overview in the MainWP menu, my ideal would be one menu heading called Extras that I could place above overview if possible else just underneath, and this one menu have the three submenu pages below. Also if possible, each link launching a new tab:
add_filter( ‘mainwp_main_menu’, ‘mycustom_mainwp_main_menu’, 10, 1 );
function mycustom_mainwp_main_menu( $left_menu ) {
$index = 1;
$sub_menu_before = array_slice( $left_menu[‘mainwp_tab’], 0, $index );
$sub_menu_after = array_splice( $left_menu[‘mainwp_tab’], $index );
$addition_item = array();
$addition_item[] = ‘Google Adwords’;
$addition_item[] = ‘addition-item’;
$addition_item[] = ‘https://ads.google.com/’;
$left_menu[‘mainwp_tab’][] = $addition_item;
$left_menu[‘mainwp_tab’] = array_merge( $left_menu[‘mainwp_tab’], $sub_menu_after );
return $left_menu;
}
add_filter( ‘mainwp_main_menu’, ‘mycustom_mainwp_main_menu2’, 10, 1 );
function mycustom_mainwp_main_menu2( $left_menu ) {
$index = 2;
$sub_menu_before = array_slice( $left_menu[‘mainwp_tab’], 0, $index );
$sub_menu_after = array_splice( $left_menu[‘mainwp_tab’], $index );
$addition_item = array();
$addition_item[] = ‘Google Analytics’;
$addition_item[] = ‘addition-item’;
$addition_item[] = ‘Redirecting...’;
$left_menu[‘mainwp_tab’][] = $addition_item;
$left_menu[‘mainwp_tab’] = array_merge( $left_menu[‘mainwp_tab’], $sub_menu_after );
return $left_menu;
}
add_filter( ‘mainwp_main_menu’, ‘mycustom_mainwp_main_menu3’, 10, 1 );
function mycustom_mainwp_main_menu3( $left_menu ) {
$index = 3;
$sub_menu_before = array_slice( $left_menu[‘mainwp_tab’], 0, $index );
$sub_menu_after = array_splice( $left_menu[‘mainwp_tab’], $index );
$addition_item = array();
$addition_item[] = ‘Google Search Console’;
$addition_item[] = ‘addition-item’;
$addition_item[] = ‘https://search.google.com/search-console/’;
$left_menu[‘mainwp_tab’][] = $addition_item;
$left_menu[‘mainwp_tab’] = array_merge( $left_menu[‘mainwp_tab’], $sub_menu_after );
return $left_menu;
}
If anyone can help it would be much appreciated.
Thanks