How to display the blog title at the top of admin page for "easy bloggers"?

I have created an environment where individuals can be members of several different blogs on the same network. It is hard, however, for my users to know which admin area they are visiting (e.g. admin of sub-site 1 or 2 or 3 etc) -- it all looks the same when when they are on the admin side of things when easy blogging is activated for them.

I'd like to create a banner that clarifies their location, a simple blog title displayed at the top of every admin page when viewed via easy blogging. I'm wondering where in the plugin code I could insert it, or (preferably) what statement I could put in the child theme function.php file.

Here's the code I was planning on using to call the title of the blog:
<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a>

    Ivan Shulev

    Hey xbladerunner ,

    I hope you are having a nice day so far!

    The one suitable hook I found was 'wdeb-menu-after_menu_items', which is fired after the menus are loaded on the side.

    Also, I would advise using get_bloginfo (https://developer.wordpress.org/reference/functions/get_bloginfo/), instead of bloginfo.

    The code I would invite you to try is the following:

    function wpmu_5433_add_title(){
    	echo '<a href="'. get_bloginfo("url") . '" title="'. get_bloginfo("name"). '">'. get_bloginfo("name"). '</a>';
    }
    add_action( 'wdeb-menu-after_menu_items', 'wpmu_5433_add_title');

    I hope this helps and I wish you an awesome day ahead!

    Ivan

    xbladerunner

    Thanks Ivan,

    I will use get_bloginfo per your advise, but I'm having trouble with the placement. Using the hook you identified, my banner ends up at the bottom of the side menu, as you described. But I would prefer it front and center on each admin page.

    Using the following code in my child theme function.php file produces basically what I want on each admin page, but it doesn't show up of course when viewed via easy blogging:

    function my_custom_admin_head() {
    	echo '<center><h2>Welcome to the <a href="'. get_bloginfo("url") . '" title="'. get_bloginfo("name"). '">'. get_bloginfo("name"). '</a> Administration Area</h2></center>';
    }
    add_action( 'admin_head', 'my_custom_admin_head' );

    Is there a hook the easy blogging plugin uses to produce admin pages (versus menu)?

    Ivan Shulev

    Hey xbladerunner ,

    I believe I've found a more appropriate hook:

    function wpmu_5433_add_title(){
    	echo '<center><h2>Welcome to the <a href="'. get_bloginfo("url") . '" title="'. get_bloginfo("name"). '">'. get_bloginfo("name"). '</a> Administration Area</h2></center>';
    }
    add_action( 'eab-admin_toolbar-render', 'wpmu_5433_add_title');

    NOTE: The reason I use "wpmu_5433" is to avoid name collisions with other plugins. The name needs to be unique. As per the official WP developer documentation(https://developer.wordpress.org/plugins/hooks/creating-custom-hooks/):

    Since any plugin can create a custom hook, it’s important to prefix your hook names to avoid collisions with other plugins.

    I hope this helps and I wish you an awesome day ahead!

    Ivan

    xbladerunner

    For anyone else hoping to do the same thing, I've included the code here. It is a little different than the code posted above in that I decided I liked having the title in the admin area WHETHER OR NOT easyblogging is activated (because sometimes even I as superadmin get lost on the backend) -- so I added another function that produces the blog title even when easyblogging is not activated. Goes in your child theme functions.php file:

    // custom header that shows up in easyblogs admin area, developed with help of Ivan at wpmudev
    function cinci_urc_custom_EASYBLOG_admin_head() {
    	echo '<br><div align="center"><h2>Welcome to the <a href="'. get_bloginfo("url") . '" title="'. get_bloginfo("name"). '">'. get_bloginfo("name"). '</a><br>Administration Area</h2></div>';
    }
    add_action( 'eab-admin_toolbar-render', 'cinci_urc_custom_EASYBLOG_admin_head');
    // custom admin header that shows up when easyblogs is not in use, developed in attempt to achieve the easy blog one
    function cinci_urc_custom_admin_head() {
    	echo '<center><h2>Welcome to the <a href="'. get_bloginfo("url") . '" title="'. get_bloginfo("name"). '">'. get_bloginfo("name"). '</a> Administration Area</h2></center>';
    }
    add_action( 'admin_head', 'cinci_urc_custom_admin_head' );

    Initially I thought about copying and hacking the custom footer addon for easyblogging, and trying to transform it into a custom HEADER addon... maybe a project for another day.