Viewing 6 replies - 1 through 6 (of 6 total)
  • mc_gabe

    (@mc_gabe)

    Hey Praveen,

    There may be a couple of different solutions here depending on what the issue you’d like to solve is.
    First, you could try adding media queries to the plugin’s CSS in order to get the particular CSS to only load for devices or display areas above a certain width. (using min-width or min-device-width).

    Alternately, you could try adding javascript conditionals within the plugin’s code around to check for desired screen sizes, and only then apply the in-page CSSor call the external CSS files in the event the size condition is met.

    We may be able to help a bit more if you can elaborate on what particular issues you have with the current behavior. If you have a link we can check out and what particular behavior you’re trying to avoid, we may be able to dig a bit deeper for you.

    Thread Starter Praveen Kumar

    (@spk100)

    Sorry…
    On this site – https://www.awesomecuisine.com, i have the form added to my sidebar as a widget. If you see the source code, the plugin has added few styles (<style>.widget_mailchimpsf_widget .widget-title {….).

    I have used the custom styling elements and would it be safe to just copy/paste these to my main css file and disable the custom styling?

    2. The mobile version of the site uses a different template but i noticed the css/js being called in the head. So, is it possible to prevent them from loading as i am not showing my sidebar to the mobile users?

    mc_dominic

    (@mc_dominic)

    Hi Praveen,

    The inline styling that is added above the plugin form can be modified by changing the mailchimp_widget.php If you look in that file, you can see where we add the inline styling.
    But moving this into an external file might affect the hierarchy of your css and affect the styling of the form. It’s usually best to use the css cheatsheet to find the appropriate id’s and classes, then add those to your sites css. Leaving the plugin files intact is best because when the plugin is updated, your changes will be overwritten.

    Currently, the plugin doesn’t allow turning off the css/js on mobile without modifying the coding of the plugin. But I will take note of that feature request and pass it along to our developers.

    -mc_d

    Please add an option to remove the inline styling. The designer should always have that choice! I don’t mind going into code, but I shouldn’t have to.

    Hi Perkster,

    Thanks for hopping in the forum. Just to give some background, the plugin does have some default styling. Generally it should inherit the styling of your site. If you checkout the the bottom of the plugin settings page, there’s a great cheatsheet which can help with styling the form. I will also take note of your suggestion of having the option of removing the inline styling.

    Let us know if you have any other questions.

    -mc_d

    Another vote to have a “disable inline css” button in the admin. It would be pretty easy to implement, like so:

    a couple steps for anyone who wants to do this:
    1) around line 993, of mailchimp.php right after the line:

    <tr><th colspan="2">Custom Styling</th></tr>

    add this:

    <tr class="mc-turned-on"><th><label for="mc_disable_css"><?php esc_html_e('Disable mailchimp inline CSS', 'mailchimp_i18n'); ?></label></th><td><span class="mc-pre-input"></span><input type="checkbox" name="mc_disable_css" id="mc_disable_css"<?php checked(get_option('mc_disable_css'), 'on'); ?> /></td></tr>

    2) around line 525 of mailchimp.php add:

    delete_option('mc_disable_css');

    3) Around line 574 of mailchimp.php add:

    update_option('mc_disable_css','off');

    4) around line 652 of mailchimp.php add:

    update_option('mc_disable_css', isset($_POST['mc_disable_css']) ? 'on' : 'off');

    5) Finally in mailchimp_widget.php before the opening closing ?> php tag that is right before the opening <style> tag, which is around line 57, add this:

    if (get_option('mc_disable_css')!='on'){

    And then after the closing <style> tag add:

    <?php } ?>

    @mailchimp would be cool if you added this to your plugin!!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to remove the inline styles and disable for mobile theme?’ is closed to new replies.