Widget CSS Classes

Descrizione

Widget CSS Classes gives you the ability to add custom classes and ids to your WordPress widgets

Please note that this plugin doesn’t enable you to enter custom CSS. You’ll need to edit your theme’s style.css or add another
plugin that allows you to input custom CSS.

This plugin also adds additional classes to widgets to help you style them easier:

  • widget-first: aggiunto al primo widget in una barra laterale
  • widget-last: aggiunto all’ultimo widget in una barra laterale
  • widget-odd: added to odd numbered widgets in a sidebar
  • widget-even: added to even numbered widgets in a sidebar
  • widget-#: aggiunto a ogni widget, come widget-1, widget-2

Caratteristiche

  • Aggiunge un campo di testo a un widget per definire una classe
  • Puoi specificare più classi inserendo uno spazio tra di loro
  • Aggiunge facoltativamente caselle di controllo con classi predefinite
  • Optionally adds a text field to add an id to a widget
  • Adds first and last classes to the first and last widget instances in a sidebar
  • Aggiunge classi pari/dispari ai widget
  • Aggiunge classi numeriche ai widget
  • Completamente traducibile
  • Compatibile con multisito
  • Compatibile con i plugin Widget Logic, Widget Context e WP Page Widget
  • Dispone di filtri e hook per personalizzare l’output, inclusi i nomi delle classi

Sito web del plugin

Riconoscimenti

Contributori GitHub

Screenshot

  • Widget di base
  • Widget con campo ID e scelte predefinite
  • Pagina Impostazioni
  • HTML generato

Installazione

  1. Upload the folder /widget-css-classes/ to the /wp-content/plugins/ directory
  2. Attiva il plugin tramite il menu Plugin in WordPress
  3. Configura le impostazioni in Impostazioni > Widget CSS Classes
  4. Visita Aspetto > Widget per aggiungere o modificare le classi e gli ID personalizzati per un widget.
  5. Espandi il widget appropriato nella barra laterale desiderata.
  6. Vedrai un campo denominato Classe CSS. A seconda delle tue impostazioni, questo sarà un campo di testo e/o caselle di controllo.
  7. Se stai utilizzando il campo di testo, puoi inserire più nomi di classe separandoli con uno spazio.
  8. Se hai abilitato il campo ID, vedrai un campo di testo chiamato ID CSS.

FAQ

Perché le classi non vengono visualizzate nel mio widget?

You need to make sure you have an HTML element defined for before_widget and after_widget in your active theme’s register_sidebar functions,
usually located in your theme’s functions.php (/wp-content/themes/yourtheme/functions.php).

Questo elemento HTML deve avere attributi class e id. Questo plugin non funzionerà se before_widget e after_widget sono vuoti.

Esempio:
register_sidebar( array(
'name' => 'Sidebar',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>'
) );

Come aggiungo il CSS per la mia classe personalizzata?

Ci sono due modi:

  1. Edit your theme’s style.css file (usually located in /wp-content/themes/yourtheme/).
  2. Usa un plugin come Simple Custom CSS.

Come esporto le Impostazioni?

You can export the Settings from Settings > Widget CSS Classes > Import/Export.

Cosa devo fare se trovo un bug?

Compila un bug report su GitHub.

Recensioni

10 Marzo 2021
This is a great and invaluable help for us frontend developers! the plugin lets you easily add your classes to any widget. thank you for developing it!
2 Aprile 2020 1 risposta
A very useful plug-in for me as a front-end developer. It’s very easy now to address directly a widget with CSS code instead of all kind of different classes to use. Thanks very, very much!
Leggi tutte le recensioni di 74

Contributi e sviluppo

“Widget CSS Classes” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.

Collaboratori

“Widget CSS Classes” è stato tradotto in 16 lingue. Grazie ai traduttori per i loro contributi.

Traduci “Widget CSS Classes” nella tua lingua.

Ti interessa lo sviluppo?

Esplora il codice segui il repository SVN, segui il log delle modifiche tramite RSS.

Changelog

1.5.4.1

  • Tested with WP 5.5.
  • Update plugin owner.

1.5.4

  • Compatibility: Fix for old single widgets (remove notice). #37 (props @westonruter)
  • Tested with WP 5.2.

1.5.3

  • Compatibility: dFactory Responsive Lightbox widget option. #33
  • Tested with WP 5.0.

1.5.2.1

  • i18n: Remove sv_SE translation from the plugin directory. It’s 95% on translate.wordpress.org and accepted as the better version. #23
  • Documentation: Readme & Wiki. #31
  • Compatibility: Tested with WordPress 4.9

Detailed info: PR on GitHub

1.5.2

  • Enhancement: Make translations of core widget classes optional instead of default. #29
  • Enhancement: Allow vertical resize of defined classes box for CSS3 compatible browsers.

Detailed info: PR on GitHub

1.5.1

  • Fix: Widget Logic widget_content filter compatibility. #27
  • Enhancement: Make uninstall script compatible with network installations.

1.5.0

  • Feature: Option to try and fix the widget parameters if they are invalid. #24
  • Feature: Option to remove duplicate classes. #25
  • Enhancement: Sort classes based on the predefined classes on the frontend by default. #19
  • Enhancement: Classes filter for frontend (for sorting or modifications). #19
    • widget_css_classes: modify all classes added by this plugin.
    • widget_css_classes_custom: modify custom input classes.
  • Enhancement: Plugin settings filter (widget_css_classes_set_settings), overwrites user settings. #16
  • Enhancement: Plugin default settings filter (widget_css_classes_default_settings). #4
  • Enhancement: Capability filters for form fields. #21
    • widget_css_classes_id_input_capability: ID input
    • widget_css_classes_class_input_capability: classes input
    • widget_css_classes_class_select_capability: predefined classes select (also hides classes input if invalid)
  • Compatibility: WP External Links. #17, thanks to Victor @freelancephp
  • Fix: Form wrapper div style. #18, thanks to Chuck Reynolds @ryno267
  • Fix: Enable sortable input selection (IE-11 fix). #20
  • UI: Enhance setting page JavaScript and remove relCopy library dependency.
  • i18n: Remove Dutch and Russian languages from plugin distribution (available on translate.wordpress.org). #23
  • Started using TravisCI and CodeClimate. #15

Detailed info: PR on GitHub

1.4.0

  • Caratteristica: Ordina classi predefinite (grazie Jory Hogeveen)
  • Sicurezza: impedisce l’importazione non autenticata delle impostazioni
  • Fix: Notice message when classes is empty (thanks Jory Hogeveen)

1.3.0

  • Feature: Change dropdown to checkboxes for multiple class selection
  • Feature: Option to use both predefined and text input classes
  • Feature: Migrate classes when predefined classes are available
  • Improvement: Do not show previously defined classes that are removed in the settings page when a widget is not updated yet
  • Fix: Only show stored classes if the field-type in the setting page is correct
  • Fix: When predefined is selected, show previous text input classes if they are defined
  • Fix: Ids index notice
  • i18n: Added Dutch translation by Jory Hogeveen at Keraweb
  • i18n: Added Russian translation by Наталия Завьялова
  • i18n: Added Swedish translation by Olle Gustafsson

1.2.9

  • Changed h2 to h1 on settings page
  • Changed plus/minus icons on settings page to dashicons

1.2.8

  • Added text domain to plugin header in preparation for automatic language translations

1.2.7

  • Changed class and ID fields to full-width
  • Added missing escaping from settings page
  • Enqueue admin scripts on correct hook
  • Fixed undefined notice when option was not found

1.2.6

  • Fixed error notice

1.2.5

  • Fixed notice

1.2.4

1.2.3

1.2.2

  • Fix for notice on line 103 when using Widget Logic
  • Tested with WordPress 3.7 beta 1

1.2.1

  • Added Slovak translation by Branco WebHostingGeeks.com
  • Updated Widget Context compatibility fix plus notice fix by Joan Piedra
  • Changed jQuery live to on for 1.9 compatibility

1.2

  • Replace ID with custom ID rather than appending to existing ID
  • Added settings to not show numbered widget classes, first/last classes, and even/odd classes

1.1

  • Added support for Widget Context plugin
  • Fixed notices appearing when Widget Logic plugin was enabled but filter was disabled
  • Added Hide option for the Class Field Type in Settings
  • Don’t show any previously added IDs in front end if Show Additional Field for ID is set to No
  • Don’t show any previously added classes in front end if Class Field Type is set to Hide

1.0

  • First version