Your widgets will get an ID based on the class name you specify.
You can then write a CSS selector based on those values. Say that you prefix your widget classes with ‘foo_’, then you can select them with:
div[id*="foo_"] {
background-color: red;
}
To add that to the admin pages add something like this to your functions.php:
add_action('admin_head', 'custom_widget_css');
function custom_widget_css() {
echo '<style>
div[id*="foo_"] {
background-color: red;
}
</style>';
}
Related Posts:
- How Can I Add the “Insert From URL” Tab to a Custom 3.5 Media Uploader?
- Where is the content of widgets stored in mysql table
- How to refresh Theme Customizer after change color inside wpColorPicker?
- How do I rebind event after widget save
- Determining a Widget Instance and Sidebar Location?
- Randomize widgets displayed in my sidebar [duplicate]
- Calling static method in the Widget Class
- Remove […] from RSS feed?
- Difference between widget form code variables
- How to create a widget that has a submit form in the front end
- Modifying recent post widget to include icons for post titles
- Unfiltered html in widget title not working
- How to process content in a widget? [duplicate]
- How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?
- How do I embed in a text widget?
- check for shortcode in post/pages AND widgets AND template files
- Why can’t I add this feed to the RSS widget?
- Why use dynamic_sidebar() conditionally?
- WordPress Widget multiple use
- Contact Form in sidebar [closed]
- Display the date before the post title in recent posts widget
- Using Advanced Custom Fields in a widget
- Closest thing to an is_widget() tag?
- More flexible sidebar and widget management
- Dynamic Sidebars On Multiple Subpages
- Can I remove a widget area without editing code?
- Need some help understanding widgets
- Cannot save widgets in custom sidebars
- Disable widgets on specific posts
- register widget class not written in theme
- Font awesome Icon HTML in widgets disappear on save
- How to determine the number of widgets contained in a sidebar via customizer JS
- Hide widget if user is logged in without plugin
- Toggle option in sidebar widgets
- Add field to dashboard to update embedded URL on homepage?
- How can hide widget title if custom widget is empty
- styling back end widget form and enabling multi widget feature
- How to show different widgets on different pages in a user friendly way
- widgetlogic and permalinks
- allow user to style widget backgound per widget
- I’m trying to find a basic plugin for displaying images in a widget [closed]
- A form in a custom widget
- Elementor widgets – conditional controls
- Widgets in home.php redirect to index.php
- How to make a can’t hide widget?
- How to track whether the user has changed the value of the field in the widget or not?
- Problem creating an array instance in a widget in 4.4 update
- Redirect to page after a widget form submit
- WordPress: How to embed a widget on a separate website?
- Widget on the right side of the page overlaps with the left side [closed]
- Where to put custom widget file?
- Making tags appear as an Unordered list instead of a ‘cloud’
- Shortcode not working in widget
- How to pass a special CSS class into widget li
- Show Woocommerce Product “attributes/extra information tab” in widget [closed]
- How to use the widget area to extend the page content?
- wordpress widget missing jquery
- Display a widget on a specific type of archive
- Add a specific css to a widget
- Widget Title is not saving in backend
- Add class to on sidebar widget
- Save button is not working on custom widget
- WordPress update not saving
- WordPress Edit Button not appearing for widget in customizer
- WordPress database error – quick review
- Select two value from meta key and post meta
- Enqueue script only when side widget is used
- wrapper div for widgets not showing with all widgets
- Widget page stopped loading
- Check if widget is inside sidebar with PHP
- looping widgets to organize bootstrap grids
- Widget : html 2 dimensional array doesn’t work
- call widget from within shortcode
- How to get class from widget area
- In widget, the value of select field doesn’t get updated, changes after saving
- Text Widget to Show database fields based on post
- Editing Help Section
- Widget constructor: about $id_base and $options
- Display Login user name in Thim:login Popup widget
- Searching for a one page overview widget
- WP renders HTML wrong when adding widgets
- Adding pagination to my theme [closed]
- How do I add after the tag in WordPress widget?
- Creating a simple button inside of a widget
- Reposition the widget sidebar in Appearance->Widgets
- Hiding the widget meta box in the Appearance->Widget screen
- The WP_Widget class seems to run many times on a page load
- How to check widget-cpt meta and display its custom css in the head?
- How to add WooCommerce Add to Cart button in widget?
- How to call theme default widget in custom template?
- How to place a widget beside a div/text so that they display as a continuous line
- How can I build a widget area widget using the built in WordPress functionalities?
- Widget Logic code for different PMP membership levels
- How to Activate WordPress Widgets
- How to display a widget available for all themes
- How to output built-in widgets with number in range as class?
- widgets in contacts only
- How to create a widget on witch a registered user can create a checklist
- Extending Widgets – Exclude # of posts field from Recent Posts Widget
- How can I create my own widgets in WordPress? [closed]