CMB2 comes with default styles, but you may want to disable them if you’re outputting forms on the front end so they can be styled to match the rest of the site.

Here’s how to disable CMB2 styles for all front end forms:

Or if you’d rather prevent the CMB2 styles from being enqueued on a per-form basis, you can set the cmb_styles argument to false when you call cmb2_metabox_form(), like this:

1 comment

  1. Justin Sternberg August 17, 2016 at 11:29 am

    Reply

    This is a handy post, and I’ve added it to the CMB2 wiki: https://github.com/WebDevStudios/CMB2/wiki

    Just as a heads up, it’s important, when using the cmb2_enqueue_* filters to only disable for your specific conditions/scenarios. It’s entirely possible that another plugin/theme is using CMB2 and *needs* the styles on the front-end, so blindly disabling can cause issues.

Leave a reply

Your email address will not be published. Required fields are marked *