You can use the following code. Asuming that the css file style.css
is inside the css folder of your theme:
function wpse_126614_enque( $hook ) {
if ( 'widgets.php' != $hook ) {
return;
}
$template_url = get_template_directory_uri();
wp_enqueue_style( 'admin-style-widget', $template_url . '/css/style.css' );
}
add_action( 'admin_enqueue_scripts', 'wpse_126614_enque' );
Related Posts:
- Adding inline styles from a widget
- Can’t work out why widget contents disappear from admin
- How to check if a WordPress core block is active in sidebar
- Using wp_add_inline_style without a stylesheet
- How important is it to enqueue a theme’s stylesheet?
- Can I create my own “Recent Posts” widget or customize the existing one?
- How to store widget fields data as an array?
- Enqueue a stylesheet for login page and make it appear in head element
- Adding a div to wrap widget content after the widget title
- What is the difference between wp_register_sidebar_widget and register_widget?
- How to enqueue script if widget is displayed on page?
- Change admin bar to default:off
- Call dynamic_sidebar but include/exclude named widgets?
- Should I use set_transient or update_option?
- HowTo: Add Class to Sidebar Widget List-Items
- Why I can’t add a CSS style in this WordPress theme?
- How to make a theme with more than one CSS file?
- Including CSS and JS on Admin Screen of Custom Theme Options
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- register_sidebar ignores ‘id’ and ‘class’
- How wp_cache is supposed to work, and does it help with performance?
- Adding customizer styles with wp_add_inline_style
- How to customize wordpress login/register pages?
- What can I hook into after_setup_theme?
- How to determine the current widget’s parent container (sidebar widget id)
- Adding widgets programatically: how to avoid collisions?
- Add class to before_widget for all widgets with a dropdown and a counter
- Enabling Widgets By Default in Custom Theme Development
- Identifying the priority of style.css so I can make a small CSS file load last
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying
- File included into functions.php via require_once() won’t echo?
- modify a output of a widget
- Context aware widgets. My work in progress
- The best way to add stylesheets to WordPress
- How to determine which sidebar the widget has been added to, via widget admin?
- How can I add an incremental class identifier to my sidebar widgets?
- How to Modify a Widgets UL and/or LI Classes
- Should use widgets in this case?
- Enabling Default Widgets in a Custom Theme
- how to create theme based widget that can be drop in sider bar or footer
- Advantages of using instead of wp_enqueue_style()?
- How to add a text widget during theme activation
- How to add dynamic inline style?
- Adding WordPress colorpicker in widget settings
- Enqueued Stylesheets Effecting Admin Styles
- How to add multiple custom widget areas
- How do I display the “Archives” widget layout (sidebar) in WordPress by ‘year’ then by ‘months’?
- Add social icons in a theme through custom admin menu
- De-registering parent style sheet css recommended?
- Different Admin Theme – Based on Role?
- Display site admin profile fields in header.php
- Is it a good idea to make whole theme widgetized?
- Theme Customizer – Choose where widget area appears, to let users organise widgets
- Add tinymce to widget textareas
- How to determine which registered sidebar area a custom widget is loaded into
- Widgets with groups / sub widgets? Widget in a widget?
- How i can get widgets areas working in customizer?
- How to determine if post has widget content?
- enqueue_style is not working
- Administration Pages Styling
- Dequeue a style file which is making website load slow!
- searchform.php override not working
- Is my approach to enqueue styles inefficient?
- Child theme style.css versioning
- How to make content editable from admin page?
- Disable wp_enqueue_style for theme on wp-admin
- functions.php not hooking up with style.css
- How can I let templates choose which stylesheets are enqueued?
- Widget items disappearing
- How can i initialize a widgetized sidebar (with widgets)
- How do you force a sidebar widget to have a container div around all child widgets?
- Add widgets to available widgets section without changing the theme?
- How can I display/hide certain content based on a Theme Option field?
- Stylesheet not linking
- Is it possible to edit the styling of the admin panel from within a custom theme?
- Custom Widget options in theme
- Can I have a widget and sidebars in custom theme?
- Where can i design and modify a new mail template for sending emails to users when commenting?
- Theme Loading Into Dashboard
- Disable dashboard drag&drop
- Save Widget State Between Theme Swaps?
- Font Awesome 5 Free – far working but fas is not? [closed]
- “Add A Widget” button in the Customizer
- How remove render blocking css from wordpress when you build a theme?
- $this->get_field_id() not working in customizer
- Permanently activate WordPress theme
- Displaying details of a post in a sidebar
- How do i place same widgets multiple time by default on theme activation?
- Add attachment for all images in post
- How to remove text “Log In” from login page
- Widget Option is Missing
- How to use widget in a widget-less WordPress theme?
- filemtime(): stat failed warning within a child theme
- How can I develop multiple widgets for a WordPress theme?
- Is it acceptable for a WordPress theme to not accept widgets?
- How do I use a color from theme options?
- Register sidebar ‘before’ and ‘after’ html as div rather than li tags
- How to remove ID’s from wp_enqueue_style?
- Ideal inline dynamic CSS injection