Skip to main content
All CollectionsMainWP Customization
How to add WP Admin button to the main Navigation bar
How to add WP Admin button to the main Navigation bar
Updated over 2 months ago

We moved the WP Admin link to the three-dot menu in the top right in order to streamline the navigation bar.

If you wish to return it to the main navigation sidebar, we prepared PHP and CSS code snippets.
The easiest way to apply them is by using our Custom Dashboard extension.

PHP code snippet

Place the following PHP code in the PHP tab in the Custom Dashboard extension and click Save:

add_filter( 'mainwp_main_menu', 'mycustom_mainwp_main_menu', 10, 1 ); function mycustom_mainwp_main_menu( $left_menu ) {     $index = 10; // Position of the menu item being added.     $sub_menu_after = array_splice( $left_menu['leftbar'], $index );     $addition_item = array();     $addition_item[] = 'WP Admin'; // This is the title of the menu item being added.     $addition_item[] = ''; // Parent key.     $addition_item[] = 'index.php'; // This is the URL of the menu item being added.     $addition_item[] = 'custom-wp-admin-item'; // The ID attribute.     $addition_item[] = '<i class="wordpress icon"></i>'; // This is the icon of the menu item being added. You can find all available icons here: https://fomantic-ui.com/elements/icon.html.               $left_menu['leftbar'][] = $addition_item; // Add the additional item to the leftbar array.     $left_menu['leftbar'] = array_merge( $left_menu['leftbar'], $sub_menu_after ); // Merge leftbar and $sub_menu_after arrays.     return $left_menu; // Returns updated $left_menu array. }

CSS code snippet

Place the following CSS code in the CSS tab in the Custom Dashboard extension and click Save:

#custom-wp-admin-item {
padding-left: 10px;
padding-right: 10px;
position: absolute;
bottom: 0;
}

Did this answer your question?