Custom Fields
Re-Envisioned
Support Meta Box Builder CSS classes not displaying

This topic contains 5 replies, has 3 voices, and was last updated by  Anh Tran 4 months ago.

  • Creator
    Topic
  • #12818
    Resolved
    joycekwc@gmail.com
    Participant

    I have just installed and purchased Meta Box Builder, and created some simple fields that I want styled with a custom CSS class. I have managed to display the fields on the front end (although I think the documentation on this could be improved, as I bought Meta Box Builder on the premise I wouldn’t need to touch the php files).

    However, the contents of the metaboxes are not displaying with the style of their custom classes. The custom CSS classes are added in the theme itself through Theme options, so I’m wondering if that might be a problem? The only tutorials I can see add the CSS directly in the .php file.

    UPDATE – Adding CSS classes directly into the php file does work, but keen to hear what I might be doing wrong with the Meta Box Builder custom classes field.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #12820

    Anh Tran
    Keymaster

    Hi, did you try adding CSS classes to the field via custom attributes? Go to tab Advanced, and add a new attribute, name it “class” and enter value = your custom CSS classes.

    #15057

    Chris
    Participant

    Joyce didn’t reply, but I have the same issue(s). I agree with the lack of documentation for Builder, as opposed to doing it manually.

    In this case, I did add a custom css class added via my theme (Customizr Pro) and it didn’t work either in the Appearance Tab / Custom CSS or when I added it as an Attribute in the Advanced Tab. I tried applying it to a textarea field.

    Is there something else that would work?

    thanks,
    chris

    #15061

    Anh Tran
    Keymaster

    Hi Chris,

    Sorry for the lack of documentation. I’ll keep adding them.

    Regarding the CSS class, please add the class as in this screenshot:

    View post on imgur.com

    And you’ll see this class here:

    View post on imgur.com

    #15076

    Chris
    Participant

    Hi – I don’t recognize that last screen shot, so I assume it’s Gutenberg? I’m using the classic editor, so I did a “view page source”, and my class wasn’t there, even though I set it up the way you showed on the earlier screen.

    However, since I want the formatting done on the users’ screen, I was able to get what I need by formatting the [rwmb_meta id="zzzz"] in the editor.

    I’m sure it will get easier and even more useful as I work through it. Thanks for your help.

    chris

    #15080

    Anh Tran
    Keymaster

    Hi Chris,

    If you’re using the classic editor, you’ll see the class here:

    View post on imgur.com

    Another note: you can add the CSS class simpler by going to tab Appearance and enter your class into “Custom CSS Class”:

    View post on imgur.com

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

You must be logged in to reply to this topic.