Plugin Logo Missing | Admin Toolbar (Frontend)
-
Good Day,
Your plugin’s logo does not display in the admin toolbar frontend, only the backend.
Admin Toolbar (Frontend): Logo Not Displayed
Admin Toolbar (Backend): Logo DisplayedPlease review and provide a fix.
Thank you!
-
Update:
To assist you (and the community), I developed the code snippet provided below to solve the above. Add it to your functions.php file via the plugin, Code Snippets. Set the the code snippet to run only on the frontend.
Result: Click here
It would be great if you can incorporate the intent of the code snippet into your plugin at your next convenient plugin revision.
Thank you!
—————
Code Snippet: (Add Plugin Logo to Admin Toolbar – Frontend)
function override_admin_toolbar_analytify() {
if ( is_admin_bar_showing() ) { ?>
<style type="text/css">
#wp-admin-bar-analytify > .ab-item::before {
content: url(/wp-content/plugins/wp-analytify/assets/img/wp-analytics-logo.png);
margin-top: .1em!important;
margin-right: .05em!important;
}
#wp-admin-bar-analytify:hover > .ab-item::before {
content: url(/wp-content/plugins/wp-analytify/assets/img/wp-analytics-logo-blue.png);
margin-top: .1em!important;
margin-right: .05em!important;
}
</style>
<?php }
}
add_action( 'wp_head', 'override_admin_toolbar_analytify', 20, 3 );Another Update:
Use the code snippet given below when using the Script Manager feature of the plugin, Perfmatters to eliminate duplicate icons and redundant admin toolbar quicklinks that appear on the frontend.
Cheers!
—————
Code Snippet: (Add Plugin Logo to Admin Toolbar – Frontend, Applicable Only When Using the Plugin Perfmatters)
function override_admin_toolbar_analytify() {
if ( is_admin_bar_showing() ) { ?>
<style type="text/css">
#wp-admin-bar-analytify > .ab-item::before {
content: url(/wp-content/plugins/wp-analytify/assets/img/wp-analytics-logo.png);
margin-top: .1em!important;
margin-right: .35em!important;
}
#wp-admin-bar-analytify:hover > .ab-item::before {
content: url(/wp-content/plugins/wp-analytify/assets/img/wp-analytics-logo-blue.png);
margin-top: .1em!important;
margin-right: .35em!important;
}
/* Remove Duplicate Icon That Appears on Frontend When Perfmatters' Script Manager Used */
#wp-admin-bar-analytify .ab-icon {
display: none!important;
}
/* Remove Unnecessary Quicklinks That Appear on Frontend When Perfmatters' Script Manager Used */
#wp-admin-bar-gform-forms {
display: none!important;
}
#wp-admin-bar-gappointments {
display: none!important;
}
</style>
<?php }
}
add_action( 'wp_head', 'override_admin_toolbar_analytify', 20, 3 );Hi @generosus,
Thank you for taking the time to work on the solution! But strangely, this issue is not replicated on our end. We have checked it on multiple sites and the icon is showing on the front-end admin toolbar.
Can you please debug on your end what can cause this issue? Thanks!
Hi @emma24,
Thanks for that! Please accept my sincere apologies. Problem fixed.
Using Perfmatters, I had inadvertenly dequeued the following asset in the frontend:
/wp-content/plugins/wp-analytify/assets/css/admin_bar_styles.cssHave an amazing day!
No worries, @generosus.
Glad to know we are error-free here. 😄
The topic ‘Plugin Logo Missing | Admin Toolbar (Frontend)’ is closed to new replies.