• Resolved ejunion

    (@ejunion)


    Currently the plugin is inserting a long list of styles into the head of my site. Is there a way to remove these styles and put them into a stylesheet instead?

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Rui Guerreiro

    (@takanakui)

    Hi,

    That needs to be done that way because the css is dynamic, because it’s generated based in your settings.

    If you have no intentions to change the options that affect the css we could try to place that css in a static file and remove the inclusion of the dynamic css in the head.

    Let me know.

    Thread Starter ejunion

    (@ejunion)

    Hi Rui,

    Ideally I would like to take the current css from the head and place in a static file. I understand I would lose the dynamic css if we do this.

    Thanks,

    Erica

    Plugin Author Rui Guerreiro

    (@takanakui)

    Inside the file class-wp-mobile-menu-core.php located at wp-content/plugins/mobile-menu replace this line

    add_filter( 'wp_head', array( $this, 'load_dynamic_css_style' ) );

    by this 2 lines

    //add_filter( 'wp_head', array( $this, 'load_dynamic_css_style' ) );
    wp_enqueue_style( 'mobmenucss', plugins_url( 'css/mobmenu.css', __FILE__ ) );

    And upload the file mobmenu.css to wp-content/plugins/mobile-menu/includes/css/ with the css grabbed from the head of your site.

    Here is that file.
    https://www.dropbox.com/s/qwbmc2lu2uwcpbs/mobmenu.css?dl=0

    Let me know the result.

    Thread Starter ejunion

    (@ejunion)

    Perfect that was exactly what I was looking for. Thank you!

    Plugin Author Rui Guerreiro

    (@takanakui)

    Great. Glad it’s working.

    If you’re enjoying WP Mobile Menu, rate and review the plugin to spread the word!
    Thanks

    Thread Starter ejunion

    (@ejunion)

    An error has appeared that I didn’t see before. I’ve reverted the changes but am still seeing the error. The error can be seen at the bottom of the page on mobile view. The only other changes I have made today were to my W3 cache plugin.

    Notice: Undefined variable: logo_output in /var/www/vhosts/swcsandbox.com/httpdocs/wp-content/plugins/mobile-menu/includes/class-wp-mobile-menu-core.php on line 201

    Plugin Author Rui Guerreiro

    (@takanakui)

    That situation isn’t related to the change above. That was an error in the initial 2.5 version that is already fixed.

    The best way to sort this is to the delete the current plugin directly in the plugins page and install it again from the WordPress Plugins Repository.

    Don’t worry about the settings because they are stored in the database and that won’t change.

    After doing this apply again the code modification I provided earlier.

    Thread Starter ejunion

    (@ejunion)

    Gotcha. I reinstalled the extension and didn’t see the error go away and then I’ve also tried updating class-wp-mobile-core with the file here from a previous thread https://www.dropbox.com/s/p6w52vpr9k1yotv/class-wp-mobile-menu-core.php?dl=0

    I’ve cleared all cache and still am not able to get the error to go away. However, if I change the logo from an image to text the error disappears.

    Thank you for the quick response!

    Plugin Author Rui Guerreiro

    (@takanakui)

    That file doesn’t seem to be the correct version, because it’s from 13 of November and I made that correction on 15 of November.

    Check if you have the line on the screenshot below.
    https://cl.ly/1b2y0j3T400c

    Thread Starter ejunion

    (@ejunion)

    That did the trick! Thanks again

    Plugin Author Rui Guerreiro

    (@takanakui)

    No problem.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Remove CSS from Head of Site’ is closed to new replies.