Take a look here at the CODEX for an example on how to do this very thing.
Example: Load CSS File on All Admin Pages
function load_custom_wp_admin_style(){
wp_register_style( 'custom_wp_admin_css', get_bloginfo('stylesheet_directory') . '/admin-style.css', false, '1.0.0' );
wp_enqueue_style( 'custom_wp_admin_css' );
}
add_action('admin_enqueue_scripts', 'load_custom_wp_admin_style');
Example: Target a Specific Admin Page
function my_enqueue($hook) {
if( 'edit.php' != $hook )
return;
wp_enqueue_script( 'my_custom_script', plugins_url('/myscript.js', __FILE__) );
}
add_action( 'admin_enqueue_scripts', 'my_enqueue' );
Related Posts:
- Why are my styles being applied to the admin area?
- Fixed layout for admin section
- What are the standard admin CSS id/class tags?
- This CSS Stuffing Works, But Is This A Good Practice?
- How do I load a CSS style into WordPress admin area only?
- How can I target WordPress 3.8 new interface MP6 with CSS?
- Load plugin scripts and styles only on plugin page
- How to fix admin stylesheet muck-up? [closed]
- Custom CSS In Admin Only For Certain Roles
- Modify CSS via Theme Control Panel
- Adding another “Add Post” button to admin
- Enqueue and Dequeue from admin bar nodes
- admin_enqueue_scripts the same css file as wp_enqueue_style
- WordPress admin toolbar not loading styles after migration
- Load stylesheet on custom admin submenu page
- Black admin bar is being hidden by page elements
- WordPress Admin Thickbox: Remove Margins/Padding
- Modal window from within WordPress admin
- How important is it to enqueue a theme’s stylesheet?
- How do I remove dashboard access from specific user roles?
- Inbuilt style for jquery-ui-datepicker
- Why is style.css not being enqueued?
- Search posts by ID in admin
- Sort pages in loop by admin’s page attributes order field?
- Edit “thank you for creating with WordPress” in version 3.3.1
- Disable Media Uploads to non Admin Users
- sort child pages on admin
- How to remove list view from media library?
- Add my own button next to “Screen options” and “Help” in the admin
- How do I set up the defualt page icon for admin menu?
- Disable all https in WordPress
- Can a users profile be put under the dashboard menu
- Styling Shortcodes in Visual Editor
- How to make a theme with more than one CSS file?
- WordPress admin screen very slow / timing out when editing or adding a new page/custom post
- turn off new user registration emails
- Give priority to child theme stylesheet
- Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area
- Use wp_enqueue_scripts, not wp_print_styles?
- Thickbox hacking – removing fields
- How to let authors revise other authors drafts, but keep them from publishing?
- WordPress last login foreach user
- custom tabs in media uploader
- How to customize this automatic slug shortener with an overrwrite function
- Hide content-box on specific pages (in admin)?
- Moving a WordPress site to a new server
- How Can I Use A Child Theme Effectively When Parent’s CSS Is Located in a ‘CSS folder’?
- Style.css in child theme is loaded before Bootstrap
- Enqueued Stylesheet Version Number Not Being Appended
- Admin Notices coding standard issue
- Understanding child theme functions.php
- What are WordPress admin supported browsers?
- user-new.php less detailed after WP3.1; how to revert?
- How can I remove the “updates” menu in the WordPress Admin panel?
- Where does WordPress store a list of Super Admins?
- Get current logged in user under 3.1, re: remove “Howdy”
- Override load-styles.php with admin screen css
- How do I change Administrator to Super Administrator
- Include user defined styles without including wp-load
- Remove Admin sidebar link
- Find Memory Usage of Admin
- How do you set up a WordPress blog with multiple authors to allow something like StackExchange’s “community wiki” feature?
- One button on admin page works but not two
- Display popup or admin-notice after add new categories
- WordPress post feature image not uploading
- Redirect in an Admin page
- How do I use a color from theme options?
- How to add CSS via custom plugin?
- How can I POST or GET to the same admin page from which I am POST-ing or GET-ing
- Ideal inline dynamic CSS injection
- How to include a file only on dashboard widgets page?
- Passing dynamic options from backend to frontend
- Access for adding subpages but not for pages
- I’m a super admin and I want to give an admin the ability to add new users…?
- Return User Meta text as links to post edit inside the user columns
- str_replace inside specific css files [closed]
- WordPress Admin Menu Order for ‘admin.php’ pages
- Show global Message in User Profiles with admin only Input field in WordPress Backend
- How to pass a specific post id from “all posts” list in Admin panel
- How should I setup the “Users” area to hand over to a client?
- Default scripts added to each admin page
- Settings API – Last two tabs not rendered separate
- Adding a WordPress Admin Dashboard to my local wordpress site
- Stylesheet does not load despite functions.php
- cannot access the wordpress dashboard after changing the site url
- Reset WordPress admin users to limit access
- Is it possible to push admin notices to one specific user instead of all users?
- Set different css stylesheet for specific pages [duplicate]
- How can I create multiple different admin roles with their own capabilities
- Custom redirection when managing users in admin
- How to retain HTML5 Attributes on Markup
- Why doesn’t the Media Browser use thumbnail sized images?
- Improving this link color picker code
- Change Admin URL
- Change the Author name to a custom field?
- How to remove certain feed from my dashboard in WP admin
- Buddypress send admin notification email when new subscriber registers
- Background image in login showing in admin area
- How to create my own style.css file in an wordpress child-theme
- Modify ‘the_content’ appearance in the admin area