简体   繁体   中英

How to remove wordpress theme to override plugin css and js

guys! I have a wordpress website that has installed Kalixo Magazine theme. I tried to install several widget menu plugins with interesting designs, but always the design( i think the css and js/jquery) is the default one from the theme. How can I stop my theme to override the css of widget menu plugin so I can have a unique menu on my sidebar ? Thank you in advance!

I think the problem has anything to do with your theme, rather it is with the plugins. I suspect that the plugin authors has not set a priority when they registered/hooked the stylesheets to wp_enqueue_scripts hook. This will cause the plugin style to load to early, and all styles later gets overridden by the themes' stylesheet

I would suggest, create a child theme, and then copy the complete stylesheet from the plugin to your child themes' stylesheet. The child themes' stylesheet will be loaded lastn so give this a try

The Best way to do this is de_register that plugin CSS from your WordPress site and then add the CSS of that plugin into your main style.css file. This way it will take only a single css file to render all the styling and will not overload your website.

add_action( 'wp_print_styles', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
    wp_deregister_style( 'contact-form-7' );
    //wp_deregister_style( 'digg-digg' );
    wp_deregister_style( 'wp125style' );
}

and then load your style.css file using script_enque method for better result

you can fix this problem customize by your plugin style sheet. if you don't know your plugin, you can find it in this path wordpress\\wp-content\\plugins ....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM