Short answer, but you have a !is_admin() condition. That will prevent the bulk of that code from running on the back end. Remove that and the code should work on both front and back.
Related Posts:
- How to Remove All Admin Bar Menu Items?
- Edit specific nodes in WP_Admin_Bar
- Change the link of ‘Howdy’ at the top right
- Adding a menu item in the admin bar
- Removing admin bar from wordpress dashboard
- Display $pagenow error notice on all admin pages
- Remove All in One Pack from the admin bar
- Unable to display WordPress admin bar in the frontend as an admin
- How to Find The Email of a WP Admin Account
- Adding Notification Bubble on Admin Top Bar
- How do I change the hover (focus) color of admin bar from frontend?
- Weird white space in admin area
- Can I rename the wp-admin folder?
- How to restrict dashboard access to Admins only?
- How to disable the “Post Lock/Edit Lock”?
- How can I control the position in the admin menu of items added by plugins?
- How to remove screen options and help links in the admin area?
- I’m getting a 404 message when I try to access wpadmin
- wordpress wp-admin css not loading
- Check if user is admin by user ID
- Unable to login to my wordpress site. reauth=1 redirection loop
- wp_list_tables bulk actions
- Highlight custom widgets in the admin area?
- How do I find all admin users using phpmyadmin?
- Can I add custom attributes while adding inline scripts?
- wp-admin produces a 302 redirect to itself
- create users to site with specific language
- Hide a page in the admin end without a plugin?
- Prevent from deleting any user role but subscriber
- Restrict access to admin but allow admin_post hook
- How to set custom editor style when editing the homepage?
- How to disable or hide “collapse menu”
- Disable sticky posts feature
- Hide username from users list
- Login to wp-admin “redirect_to” points to wrong URL after migration
- Remove HTTP: from the site URL and just keep // in it
- TinyMCE Autoresize
- WordPress wp-admin suddenly lost its style
- Prevent Admin gui output from page added using add_submenu_page
- Activating Child Theme Breaks Website, Blank Page, Error 500
- Create Read Only Admin
- wp-admin blank in a clean install of WordPress on PHP 5.4 [closed]
- wp-admin is redirecting to back to home page (localhost)
- After changing Site url to https, can’t access login page
- Add custom content in user-edit.php page
- How to use Yoast SEO backend in english even if WPLANG variable is not english?
- Rename W3 Total Cache admin menu
- How can I add my script to admin using script-loader.php?
- Admin first hook that outputs HTML?
- WP Database Error (Windows Server 2008 & SQL Server)
- Cloned a site but can’t log in – redirecting to old site
- Can I edit the wp_post > post_content right before its inserted/updated?
- Should I add the IP of the server that hosts my sites to the list of authorized IPs in the wp-admin/.htaccess?
- wp-admin edit user url wont show up correct url [closed]
- Which HTTP headers to use for subdomain embedding?
- To remove default dashboard items and add quick draft widget for custom post type
- FORCE_SSL_ADMIN not working
- I get “The PHP Date/Time library is not supported by your web host.” on my CentOS host, what library to I need to install to add support?
- How can I allow core, plugin, theme update checks only for selected admins?
- How to check if upload window came from the featured image link?
- Today, without warning, all admin panel logins redirect to home page after login. non-admin users logins work well
- Reusable content block
- Wrong wp-admin URL
- What is wrong with this code to remove wp admin bar from one page
- Stopping user deletion from running on error
- Admin search not working for any type of post
- admin_post action not usable if admin access denied to user
- Can’t log into wp-admin after migration from localhost to server
- Adding Custom Capabilites
- Display checked in checkbox theme admin page when reloaded
- Why is unfiltered_upload not working despite being enabled?
- List All Enqueued Scripts and Styles
- Can I add my own profile.php?
- Wp-admin is giving me an error “Sorry, you are not allowed to access this page.”. I do have access to the wp-admin besides the dashboard itself
- Add menu option to “New Post” menu in admin bar
- Linking table cells to network folders
- Remove bulk option row
- Admin menu in front-end
- How can I disable all external url Google in WordPress backend?
- if it possible to get all notifications from all plugins and core?
- wp-admin page redirecting to 404 error page
- Require Login Redirect to Login Page
- How to fix ob_end_flush() failed to send buffer of zlib output compression (1)?
- Delete the “wp-admin” folder – what could go wrong?
- Nickname field isn’t appearing in Admin
- Change users.php WP_User_Query
- Blank page when viewing wp-admin
- Is it possible to display my theme sidebar in wordpress admin?
- How to access wordpress from domainB which is installed at domainA
- How to change the URL of sub menu page?
- Change wordpress admin home page
- Strange wp admin edit buttons issue
- Cannot access wp-admin after migration to another place
- Regular users logs in as ADMIN if Admin logged in recently
- Not able to access WP admin Page, redirected and a drop down login menu appears 401 error
- OSX El Capitan local install Maximum upload file size: 2 MB But php.ini set to 64M
- Is it possible to outsource wp-admin to another server?
- Search box for hierarchical taxonomies in admin interface
- Custom Admin Message from external source to multiple users
- Fresh Install – WP6 – Sorry, you are not allowed to access this page