Title: Adding class or id to add_settings_fields
Last modified: August 20, 2016

---

# Adding class or id to add_settings_fields

 *  [Javier Schvindlerman](https://wordpress.org/support/users/javistuff/)
 * (@javistuff)
 * [15 years ago](https://wordpress.org/support/topic/adding-class-or-id-to-add_settings_fields/)
 * Hi, WordPress Gurus!
 * I’m looking for a way to add a class or id selector to the add_settings_fields
   tag. I need to be able to format some of the fields through css, or at least 
   put them into some divs or something.
 * I know I could throw a div in the callback function of each field, but that would
   leave the Title of the field (on the left) out.
 * Is there any possible way to do that?
 * This is the function that outputs the options page:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * Edit: I’m rethinking now… I would also need to wrap some settings_fields under
   the same section and format it differently. So I’m gonna need a class or id for
   the section too. Isn’t there in the Codex some kind of attributes for that?

Viewing 1 replies (of 1 total)

 *  Thread Starter [Javier Schvindlerman](https://wordpress.org/support/users/javistuff/)
 * (@javistuff)
 * [15 years ago](https://wordpress.org/support/topic/adding-class-or-id-to-add_settings_fields/#post-2297360)
 * Sorry for putting the code directly in.
    I would paste it from pastebin, but 
   I cannot embed it, so.. I guess I just don’t know how to. Anyway, I think you’ll
   understand my question even without the code. 🙂
 * Got it:
 * [http://pastebin.com/xicJRfea](http://pastebin.com/xicJRfea)

Viewing 1 replies (of 1 total)

 The topic ‘Adding class or id to add_settings_fields’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [Javier Schvindlerman](https://wordpress.org/support/users/javistuff/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/adding-class-or-id-to-add_settings_fields/#post-2297360)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
