Just hook your callback into admin_print_styles, i.e.:
add_action( 'admin_print_styles', 'mytheme_add_init' );
Alternately, you could add an is_admin() conditional wrapper inside your callback, and hook into wp_enqueue_scripts:
function mytheme_add_init() {
if ( is_admin() ) {
$file_dir=get_bloginfo('template_directory');
wp_enqueue_style("functions", $file_dir."/scripts/custom.css", false, "1.0", "all");
wp_enqueue_script("rm_script", $file_dir."/scripts/custom.js", false, "1.0");
}
}
add_action( 'wp_enqueue_scripts', 'mytheme_add_init' );
But the absolute best approach is to hook into your Theme’s admin page, via admin_print_styles-appearance_page_{pagename}:
add_action( 'admin_print_styles-appearance_page_{pagename}', 'mytheme_add_init', 11 );
This is a custom hook specifically for your appearance page, as defined via your add_theme_page() call.
Related Posts:
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Replacing Scripts in Admin Load_Scripts
- How to load library scripts in admin from plugins in noConflict wrapper?
- Enqueue script globally
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- How to add a javascript snippet to the footer that requires jQuery
- How do i best handle custom plugin page actions?
- How to include jQuery and JavaScript files correctly?
- How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?
- Completely remove WP_Admin_Bar for specific user roles
- Load js/css files only on specific admin UI pages
- Get list of scripts / styles and show file which enqueued them
- jQuery in header or footer
- Enqueue script only when shortcode is used, with WP Plugin Boilerplate
- Hook the Keydown Event in the TinyMCE Post Editor
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- how to use thickbox in admin?
- How do I conditionally enqueue script for CPT single post type with plugin?
- Cancel post save
- Add a jQuery function to admin pages
- WP Cron doesn’t save or in post body
- Create a clickable name in WP_List_Table for Plugin Admin
- Script won’t load via plugin class
- Check if I am in the Admin Panel (wp-admin)?
- How to add custom content under plugin row in WordPress admin plugin list?
- Inserting JS snippet in the footer if there is no wp_footer?
- Can’t get JS code to work with shortcode
- How to load the plugin only when logged in?
- How do I add a javascript file to all admin pages via a plugin?
- How to redirect to action on custom page within admin section
- WP AJAX is not working, always returns 0
- Add notification bubble notice in navigation using transients
- Add a panel to edit post
- Where should I put “run once” plugin pages?
- Enqueue scripts in footer
- Modify users.php page to create page/post on button clicked
- Issue plugin commands in admin settings page
- Programmatically modify an admin page UI of a WordPress site from my WordPress plugin
- Is there a way to ensure plugin script loads before another script?
- Problems with: manage_${post_type}_posts_columns
- Global State During an Admin Post
- conditionally load javascript & CSS for do_action() calls from plugin
- Render content after post title in wp-admin
- What stylesheets are available in core?
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- How to add WordPress Admin “Insert Link” UI (searches through existing posts for URL) and functionality into a custom plugin?
- Is it possible to restrict all admin pages except theme customisation and storefront using plugin?
- Admin – Handle data before creating or updating a post, page or custom post
- wp_filesystem put_contents issue with owner/group
- How can I replace content in the WP Admin area before an admin page is rendered?
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- How do I link to a php file in my plugin directory?
- WordPress Admin Login Custom Logo
- wp_localize_script is not adding a global variable for javascript
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- should i be checking for jquery before enqueing it in a plugin
- How to create custom settings page for custom plugin
- 400 Bad Request, in wordpress theme development, wp_ajax
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- Displaying “One Time” Notification in Plugins
- Custom Plugin – CSS works, JS doesn’t
- Wp-admin Custom User Management
- Admin Subpages without Menu entry
- unable to wp_enqueue_script(‘suggest’);
- Data not insert and update through ajax and jQuery in admin page?
- Catching Form Submission in WordPress Admin Panel
- Is it possible to load the css just on my plugin admin page?
- AJAX button with success callback. (Titan Framework)
- Enqueue a file that’s not js or css
- Disable Auto-Expanding Menu in WordPress Admin Menus
- How do I force a download in the admin area?
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Enqueue scripts inside a class in a plugin
- Enqueue ONLY Plugin Styles and Scripts
- Remove Permalink Meta Box not working?
- How do I duplicate a single post, with all its properties, and save it as a different post?
- wp_enqueue_scripts in a plugin’s class
- WordPress Plugin Authoring question about jquery and css
- Loading Images from Javascript on the Front End
- Add default value from selection
- WordPress admin panel not working
- Is “document loaded” different on admin side than public side?
- plugin css is not being applied to the page
- Adding External Gmap JS to WordPress
- I cant add is_admin control to plugin
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Append php file to footer
- How to avoid conflict if a plugin already have included open library?
- AJAX call of function containing javascript which is not loaded (Plugin development)
- Change Label of custom post type
- Ajax Response Error | just getting error as the response
- Stop unauthorised file access
- How to enable or disable check boxes in custom post type
- Redirect with message after admin_post.php
- Same header/footer in Admin, across all network sites in multisite
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- Forcing ALL plugin Admin menus into a separate menu
- WordPress multiple user roles accessing on their information on one site?
- Enqueue Script in custom plugin before other
- How do I display and edit other posts within the ‘Edit Post’ area of Wp-Admin Dashboard