Support Meta Box Conditional Logic Can I add custom CSS for a post based on a Meta Box field state? Reply To: Can I add custom CSS for a post based on a Meta Box field state?

#13402
hartsook@gmail.com[email protected]
Participant

I was able to make this work, but not perhaps most elegantly, by using the textarea field and defaulting to:

<style>.ai1ec-time.ai1ec-row {display:none !important;}</style>

Then with conditional logic I hide that field in the metabox if the user chooses that this is a "repeating" event.

I then use Beaver Tbemer to insert an html module at the top of the content area for the repeating events Themer Layout so that <style> code gets inserted before the target selector gets called on the page.

I was not able to get this css style to work on an existing MB field if I put it into the html before or after field for other fields that appear at the top of a repeating event post.