A more standard way to enqueue stylesheets in WP admin is to use wp_enqueue_style
function on admin_enqueue_scripts
hook.
if I do any changes afterwards it doesnt update
This sounds like a browser cache isssue. You can bust the cache by adding a dynamic version number parameter to the stylesheet url with the native php function filemtime
. It returns the unix time when the file was last changed. Like so,
// add to functions.php
function my_prefix_add_admin_styles() {
wp_enqueue_style( 'my_admin_styles', get_stylesheet_directory_uri() . '/wp-admin.css', false, filemtime( get_stylesheet_directory() . '/wp-admin.css' ) );
}
add_action( 'admin_enqueue_scripts', 'my_prefix_add_admin_styles' );
Related Posts:
- In the Admin Dashboard, can I choose which sections to display?
- Create custom page and custom menu
- Changing the Order of Admin Menu Sections?
- Remove unusable metaboxes in nav menu management screen
- Remove Pagination in Appearance -> Menus -> Categories
- How to add menu to Dashboard that can be viewed by all users
- Menu is invisible in admin panel but it’s visible in front-end [closed]
- Hide pages depending on role
- WP /wp-admin/admin-ajax.php produces 404
- Sort wp_nav_menu() by menu order
- Theme menu in Admin Panel
- show different admin menu to different user roles
- Navigation Menus Depth for specific menus
- Change search results order for Admin -> Appearance -> Menus -> Pages -> View all
- ‘Users’ and ‘Appearance’ have disappeared from dashboard menu [closed]
- Ad custom admin page like WordPress customizer [closed]
- How to remove menu installed in wp-admin by a theme? [closed]
- Custom Menu Broken WP 3.8.1 Update
- Use wp_logout_url() in menu creation page
- Limit User Iinterface for Admin?
- Is it possible to add a dynamic link in the main navigation in a child theme
- Rename menu items for All except super admin
- Admin top level menu, pointing to an external url
- how to remove description from menu buttons?
- In admin edit-menu screen, newly added menu items always go to the bottom of the list
- Menu page with three columns
- Additional navigation bar in header
- How to remove empty menu space when creating admin page without menu title using add_submenu_page
- Trying to add Newline in Menu item
- WordPress Dashboard add user password not working, etc
- How to work with a custom theme that someone else created before me? (details below)
- Is it possible to remove the highlighted menu on Users and highlight a different menu?
- Need Help Regarding Menu Magement in admin
- How do i make a custom top level dashboard menu item available for all users?
- how to configure this type of menu
- Menus not visible in Appearance after being registered
- How to separate sub-menu output and keep associated with parent
- wp_is_mobile() inside js
- change link of menu particular tab
- Customizing label/title output of admin nav_menu selecter
- List of WordPress menu item indices?
- How to handle change the appearance of ‘categories’ box on dashboard?
- Rename Menu icon in Twenty seventeen theme
- Critical Error when editing menu
- WordPress Menu Custom Walker Class
- How to use a WordPress’ existing admin icon?
- How to remove the site health dashboard widget?
- Show child pages by menu order using Superfish Dropdown menu?
- One site, 2 distinct sections: two different top nav menus?
- Can you have different menus and theme on a per-page basis?
- Adding a within ‘s from wp_nav_menu()
- Display link with current user’s username in it in Custom Menu
- jQuery cookie not working properly in wordpress
- Automatically generated menu
- Admin only menu/page
- wp_nav_menu_items filter :: custom menus fall outside ul class
- WP MU: Using pages from main site in other sites’ menus
- How can I add items to the menu via the PHP file?
- WordPress warning: “private_to_published” Deprecated when creating nav with wp_update_nav_menu_item()
- two different separate sections on the same site
- How to customize submenus isn wordpress theme [closed]
- How to add html attributes to the “ul” html tag with “wp_nav_menu” function?
- Can I have a different menu for each parent page?
- Conditional menu display
- Combine 2 categories in one Menu item
- Wrap list parent in div with wp_nav_menu menu
- How to add a element with walker menu right after begin of the navigation tags?
- Custom Menu not functioning properly
- Using front-page.php need new blog page
- Limit wp_nav_menu_objects() only to first-level menu items
- wp_get_archives doesn’t take effect from css or html
- Hide an item from a menu to some users
- Locking in navigation labels before changing title?
- How to Add support for sub-menu item description in wordpress?
- wp_nav_menu_items for one menu
- I can’t add more pages to menu – menu delete pages
- Confused about the correct functioning on WordPress Menus
- Admin Menu Hack (Left side in Dashboard)
- How to manipulate attributes of url-less dropdown item in a the custom wordpress menu?
- How do I remove this menu bar?
- Hide custom menu when when no menu selected
- nav-menu-template and columns in sub menu
- Auto delete menu items with zero products (woocommerce)
- menu not showing on mobile view
- Why is my navigation in my onepage not working?
- Admin menu in different languages
- Edited one page in my working menu and now all menu buttons don’t open unless I right-click and open in new tab
- Need help with Walker_Nav_Menu class
- Impossible to remove page from menu
- Bootstrap Nav Walker Sub Menu Image
- What are some of your favorite methods for creating an accessible menu?
- How to get all the menu listed in Menus Created inside the Apperance Menu?
- Add parent link to its submenu
- Can’t change link for navigation item
- Show Child of Parent Page including all other parents
- Loading wordpress menu in an external server
- Show only second level menu items? [duplicate]
- Add item ONLY to the primairy navigation
- wp_nav_menu in 3.7 add name class nav navbar-nav
- individual images as navigation design TwentyTen