WordPress is quite famous for its flexibility and advancements. Even more, WordPress provides a friendly and powerful admin panel to manage the content on the website. Besides, WordPress supports further customization of the admin panel.
WordPress admin panel has two main parts, the first one is a sidebar and the second one is the main container. The sidebar is the WP admin panel’s main navigation, and it lists all the available functionalities, including plugins, themes, settings, etc.
What if we want to add a new link to the sidebar? The answer and its implementation both are quite simple and easy to implement.
To add a custom link to your wp-admin sidebar, follow the below steps.
First, open wp-admin and go to the theme editor.
After that, copy and paste the below code in the functions.php file of the active WordPress theme.
Read Also: Custom Session in WordPress
CODE
add_action( 'admin_menu', 'linked_url' );
function linked_url() {
add_menu_page( 'linked_url', 'NEW LINK TITLE', 'read', 'my_slug', '', 'dashicons-list-view', 1 );
}
add_action( 'admin_menu' , 'linkedurl_function' );
function linkedurl_function() {
global $menu;
$menu[1][2] = "LINK";
}
Explanation
We added a new external link in the wp-admin sidebar in the above code at the first position.
I hope the above code will add a new external link to your wp-admin panel. WordPress provides much more advancements to help users with an effortless experience.
Enjoy Coding 🙂
There is a reason big-name companies like CNN use WordPress. WordPress is a popular content…
In this tutorial, I'm going to show you how to install MySQL on your computer.…
Download Turbo C++ for windows 10 in just 7 Mb and run your first C++…
We can redirect any webpage to any other or redirect the whole domain or website…
There are lots of methods to redirect pages, like refresh-redirect from META tag, redirect from…
Include files in PHP are used in appending various global or config files. We can…