How can I run a jQuery over the top menu admin bar?

Hi, I am trying to run a jQuery, but from my jupiter theme options screen. I have realized that the themes run the jQuery, just after the admin top menu bar is loaded, but I am needing to run it over it though. For inserting blank target over the admin top menu bar… could you guys give me some directions on that? Thank you!!!

  • Vaughan
    • Support/SLS MockingJay

    Hi @diegpl,

    Hope you’re well?

    You would need to use a plugin for this and run it through the admin_head filters most likely.

    However, there’s an easier option using a plugin. Our ultimate branding plugin has a custom admin bar feature which allows you to create custom menu items and edit the admin bar, you can set the targets on each and also select whether to display them based on user roles.


    If you wish to go down the jquery route, add the following to your theme functions.php or add it to a functions.php file inside /wp-content/mu-plugins

    function add_custom_admin_scripts() {
    echo '<script type="text/javascript">Your jquery here</script>';

    add_action('admin_head', 'add_custom_admin_scripts');

    Hope this helps.

  • Vaughan
    • Support/SLS MockingJay


    Sorry for the delay here.

    The cache button, is probably added to the admin bar by another plugin, or possibly a mu-plugin. UB plugin unfortunately will not be able to remove that, you would need to possibly add a custom function in a mu-plugin to remove that but you’d need to know what plugin etc is adding it.

    I have completed some features for seperating the super-admin permissions in UB plugin, but thse aren’t released yet. I’ll see if I can get the developer to see about releasing this addition in the next update hopefully. So then you will be able to select super-admin only & it will be treated seperately to admin users.

    The enable custom entry option, allows you to enable/disable the custom admin menus that you can add, so setting this to no will disable the custom menu items you added.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.