Skip to content

Instantly share code, notes, and snippets.

@contemplate
Created October 8, 2019 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save contemplate/ac07fe87b6b921a742f12fe420489e18 to your computer and use it in GitHub Desktop.
Save contemplate/ac07fe87b6b921a742f12fe420489e18 to your computer and use it in GitHub Desktop.
Bloom Email Opt-in Custom CSS Help Guide added in options panel
// Bloom Custom CSS Help
add_action( 'et_bloom_after_main_options', 'add_bloom_custom_options', 10, 2 );
function add_bloom_custom_options( $option, $current_option_value ) {
if ( is_admin() && $option[name] == 'custom_css' ) {
$optin_id = $_POST['reset_optin_id'];
printf( '<li class="et_dashboard_auto_height">
<h3 style="margin-top: 15px">CSS HELP</h3>
<div style="margin-bottom:15px;"><strong>Target This Optin:</strong><br>.et_bloom_%1$s.et_bloom_optin { ... css code here ... }</div>
<div style="margin-bottom:15px;"><strong>HIDE ON DESKTOP:</strong><br>@media screen and (min-width:981px) { .et_bloom_%1$s.et_bloom_optin {display:none !important;} }</div>
<div style="margin-bottom:15px;"><strong>HIDE ON MOBILE:</strong><br>@media screen and (max-width:981px) { .et_bloom_%1$s.et_bloom_optin {display:none !important;} }</div>
<div style="margin-bottom:15px;"><strong>HIDE CUSTOM FIELDS:</strong><br>.et_bloom_%1$s .et_bloom_custom_field{ display: none !important; }</div>
<div style="margin-bottom:15px;"><strong>SLIM INLINE OPTIN:</strong><br>.et_bloom .et_bloom_%1$s .et_bloom_form_container .et_bloom_form_header { display: none; } .et_bloom .et_bloom_%1$s .et_bloom_2_fields { padding: 0 !important; } .et_bloom .et_bloom_%1$s .et_bloom_form_container, .et_bloom .et_bloom_%1$s .et_bloom_form_container .et_bloom_form_content, .et_bloom .et_bloom_%1$s .et_bloom_form_container .et_bloom_form_header, .et_bloom .et_bloom_%1$s .et_bloom_form_container_wrapper { background: transparent !important; }</div>
</li>',
$optin_id
);
}
}
@contemplate
Copy link
Author

This gist adds a quick CSS Tips with dynamic class targeting for Bloom Optins under the Custom CSS box.
More here: https://contemplatedesign.com/insight/bloom-custom-css-help-guide/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment