When you have a huge website with many sub-sub pages and there is that one important for you page that you visit quite often but to get there you need to pass by another 999 other pages, you can easily make a link on your admin bar a have a quick access which gives you the opportunity to visit is by only one click.

Quick link on your admin bar

Add this code to your functions.php

Quick explanation

So we create an object called $args1 and we pass it some arguments like id, title, href and meta. To customise it change the “Example Link 1” to whatever you like and the href with the link to your page. Using $wp_admin_bar lets us attach that object to the already created by wordpress global variable. The last line of code hooks and calls the function add_toolbar_link by using the hook add_action to the admin_bar_menu.

If you find my blogging useful, please share it.