• imtino

    (@imtino)


    I don’t want to use any icon at all. I disable the icon by selecting the blank icon in the setting. The problem is not it’s still loading dashicons. How do you stop Mega Menu from loading the icons not just hide it but completely not load the dashicons?

    • This topic was modified 8 years ago by imtino.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter imtino

    (@imtino)

    Nevermind, there was a submenu that didn’t hide the icon. After hide that, it no longer load the dashicons. Great plugin, first time using it. It was a little of figuring out but it works great very nice.

    Plugin Author megamenu

    (@megamenu)

    Hi,

    Glad you like the plugin, and thanks for the review ??

    Dashicons will still be loaded even if you have set hide icon to true on all of your items. Dashicons are always loaded if you’re logged in as an admin (for the icons in the admin bar), and always loaded by MMM as it’s required for the sub menu arrow indicators and mobile toggle icons.

    If you really want to dequeue dashicons, there is some code in this topic which will let you do that:

    https://www.ads-software.com/support/topic/dequeue-styles-scripts-and-some-actions/

    Regards,
    Tom

    Thread Starter imtino

    (@imtino)

    I don’t know what dequeue means or does. I just simply want to removed dashicons all together. I don’t want to load it. And I noticed that MMM loads it. I don’t mind it show up on the admin.

    After adding this code to function it seems like dashicons is not loading anymore.

    function megamenu_dequeue_scripts() {
       wp_dequeue_script( 'megamenu' );
       wp_dequeue_script( 'hoverIntent' );
    }
    add_action( 'wp_enqueue_scripts', 'megamenu_dequeue_scripts', 9999 );
    
    function megamenu_dequeue_styles() {
       wp_dequeue_style( 'dashicons' );
    }
    add_action( 'megamenu_enqueue_public_scripts', 'megamenu_dequeue_styles', 9999 );

    But there’s like a second that I see something appeared in replaced of the icon and then disappeared. Is that how it is? Is it possible to get rid of it?

    Thread Starter imtino

    (@imtino)

    I’ve just noticed with above code the responsive menu no longer work. When tapped on menu it doesn’t opened up. Maybe I will just like dashicons on, it’s only 30kb.

    Plugin Author megamenu

    (@megamenu)

    “Maybe I will just like dashicons on, it’s only 30kb.”

    I think you are correct here. Dashicons is a requirement for MMM, it will cause a lot of problems if you dequeue it without fully understanding the consequences (and being able to work around those consequences yourself).

    Regards,
    Tom

    • This reply was modified 8 years ago by megamenu.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Stop loading dashicons’ is closed to new replies.