Title: Adding custom class to fields
Last modified: August 21, 2016

---

# Adding custom class to fields

 *  Resolved [Brendavo](https://wordpress.org/support/users/successful-life/)
 * (@successful-life)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-class-to-fields/)
 * Hi,
 * I need to add an additional class to the custom fields created in the plugin.
 * Example, i created a field in billing section, it gets the ID”my-field-name” 
   and the class”form-row form-row-wide”.
    But i need to add another class to it,
   like “box” or whatever.
 * for some reason function custom_override_checkout_fields( $fields
    does not change
   the classes or adds a new field.
 * [https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/](https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [ulihake](https://wordpress.org/support/users/ulih/)
 * (@ulih)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-class-to-fields/#post-4687482)
 * Hello again.
 * You may solve this with the custom js you can add from version 1.8.1 onwards.
   A simple jquery script allows you to add a css class to your custom fields.
 * With reference to the function you mentioned: My plugin does not include a function
   with the name custom_override_checkout_fields nor does WooCommerce… The only 
   thing I can offer you with the current update is the solution stated above.
 * Regards.
    uh
 *  Thread Starter [Brendavo](https://wordpress.org/support/users/successful-life/)
 * (@successful-life)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-class-to-fields/#post-4687640)
 * Thank you for your reply and sorry for opening this again.
 * I have almost no experience with jquery scripting, could you please write in 
   detail how to do this?
 * I tried adding this to the checkout script box, but after saving it just dissapears.
   I also tried pasting it in wcpgsk-user.js but that did not change anything either.
   `
   $("#billing_pastastacija_field").addClass("secondxxx");`
 *  Plugin Author [ulihake](https://wordpress.org/support/users/ulih/)
 * (@ulih)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-class-to-fields/#post-4687642)
 * This was closed. If you have problems using the solution I implemented for these
   special use cases please open a new thread.
 * uh

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding custom class to fields’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-poor-guys-swiss-knife_ffffff.
   svg)
 * [WooCommerce Poor Guys Swiss Knife](https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [ulihake](https://wordpress.org/support/users/ulih/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-class-to-fields/#post-4687642)
 * Status: resolved