{"id":2297119,"date":"2011-09-14T14:14:56","date_gmt":"2011-09-14T14:14:56","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/adding-class-or-id-to-add_settings_fields\/"},"modified":"2016-08-20T02:26:46","modified_gmt":"2016-08-20T02:26:46","slug":"adding-class-or-id-to-add_settings_fields","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/adding-class-or-id-to-add_settings_fields\/","title":{"rendered":"Adding class or id to add_settings_fields"},"content":{"rendered":"<p>Hi, WordPress Gurus!<\/p>\n<p>I&#8217;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.<\/p>\n<p>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.<\/p>\n<p>Is there any possible way to do that?<\/p>\n<p>This is the function that outputs the options page:<\/p>\n<p><em>[Code moderated as per the <a href=\"https:\/\/codex.wordpress.org\/Forum_Welcome#Posting_Code\">Forum Rules<\/a>. Please use the <a href=\"http:\/\/wordpress.pastebin.com\/\">pastebin<\/a>]<\/em><\/p>\n<p>Edit: I&#8217;m rethinking now&#8230; I would also need to wrap some settings_fields under the same section and format it differently. So I&#8217;m gonna need a class or id for the section too. Isn&#8217;t there in the Codex some kind of attributes for that?<\/p>\n","protected":false},"template":"","class_list":["post-2297119","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2297119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2297119\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2297119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}