If you create an admin theme plugin from the Codex steps, you will notice it says not to insert stylesheets as per above – although the above will work.
If you place the following inside your admin theme file, it will serve the same purpose, but uses the wp_enqueue_styles approach:
function add_admin_theme_styles() {
wp_register_style($handle="mytheme-theme-admin-styles", $src = plugins_url('wp-admin.css', __FILE__), $deps = array(), $ver="1.0.0", $media="all");
wp_enqueue_style('mytheme-theme-admin-styles');}
add_action('admin_print_styles', 'add_admin_theme_styles');
Related Posts:
- Change admin bar to default:off
- How to make a theme with more than one CSS file?
- How to customize wordpress login/register pages?
- Add social icons in a theme through custom admin menu
- Different Admin Theme – Based on Role?
- Display site admin profile fields in header.php
- Administration Pages Styling
- How to make content editable from admin page?
- How can I display/hide certain content based on a Theme Option field?
- Is it possible to edit the styling of the admin panel from within a custom theme?
- Where can i design and modify a new mail template for sending emails to users when commenting?
- Can’t work out why widget contents disappear from admin
- Permanently activate WordPress theme
- Add attachment for all images in post
- How to remove text “Log In” from login page
- Can’t use admin_enqueue_scripts or wp_enqueue_script
- How to include a file only on dashboard widgets page?
- Thesis -style Navigation
- How to remove permalinks links presents in each page of my site?
- show_option_none not working in meta box
- theme directory fallback image outputs url and not the image
- How to remove menu from WP-Admin menu
- How to override pluggable function in theme?
- Should we use get_template_part() in functions files instead of include_once?
- Reset positions of metaboxes in admin
- How bad is it if I write AJAX functions using wp-load.php?
- How to know if a child theme is being used?
- How to modify an image block in Gutenberg WordPress 5?
- WordPress Settings API error
- Remove the word ‘Categories’ from wp_list_categories
- Using Bootstrap in themes
- Add a dropdown to theme customizer
- How to control initial wp_head() output?
- How can I get wp_head() as a string instead of echoing it?
- How to access certain WP functions inside custom class, in theme folder
- How can I see what template parts are being called for rendering the viewable page?
- File included into functions.php via require_once() won’t echo?
- What is the best way to export and import theme options?
- Example of a theme organization without all the default wp files in root
- Home page for a category / taxonomy
- Disable the Custom Internal CSS added by theme.json for Certain Pages
- Unwanted blank lines before tag
- How to configure wordpress to work with Vuejs with SSR and without hashbang
- Cannot update WordPress General Settings Site Title and Tagline
- get_query_var() and permalinks
- Set default screen option for appearance -> menus
- How to add a second stylesheet to the editor
- Single Page theme [closed]
- Conditional statement to show pagination
- Can I have two different theme for two different language?
- filter “inactive” categories from wp_list_categories?
- WordPress Theme’s 404 File Getting Called Every Page Load?
- How to first edit in local WordPress editor on page and the add code?
- Custom Field created in add_meta_boxes reappearing itself again in the default Custom Metabox
- excerpt() shows different result between remote and localhost(development environment)
- Disabling Customizer Selective Refresh shortcut icons for selected controls
- How to create a custom page(not a template) in a theme
- How to override p2 breathe theme plugin in content template file?
- What’s stopping my HTML from rendering in my template parts?
- Default Permalink Type to Postname
- add_filter to parent theme helper class function from child theme
- How to Change custom post type Dashicon Color
- cannot echo the_post_thumbnails
- How to escape html generate by a loop
- Is there any solution, ide/tool etc., for automatic escaping for WordPress?
- theme style is applied on the dhasboard rather than the website
- Hestia Child theme creation
- What $handle does WordPress use for a theme’s implicit style.css?
- CSS added through customizer neglects the need of a child theme?
- How to add custom class to get_avatar()
- Shortcode call not working in WP Template
- Output richtext metabox value
- Read more doesnt work with query posts
- help needed for suit designing tool
- Dynamic Image Links Depending on Excerpt/’Single Post’ View
- Custom fields for custom post types
- How can I sort my loop based on meta data, using a form?
- What is the_permalink() on a category page?
- How to create nested array attribute
- Customizer API Multi Sections in single Panel
- Sidebar not displaying (theme development)
- WordPress theme options checkbox default checked state
- Custom themes that won’t work when theme is changed
- How can i Limit My Wp Theme To Only One Site
- WordPress Theme: What is the right way to put inline CSS loading from a CSS file
- add class to all images inside the content
- Cold Fusion to WordPress
- Creating a theme just to deploy a single page
- Make a custom field in admin post.php read only
- Weird ‘theme update’ error [duplicate]
- get_posts is duplicating
- How to display only some widgets of a sidebar?
- Custom Infinite-post-scrolling in a custom theme:
- apply_filters to featured image
- Alternating CSS classes for dynamic content [closed]
- WordPress Loop with Custom Post Type for Bootstrap Accordion [closed]
- How do I make it super customisable?
- Isotope overlapping .items because of featured images – HELP! [closed]
- Theme.json: creating different sections of the color palette
- Is there any halfway decent documentation on the wp.media JS class?