Hello Team,
I was customizing some short of information on the site and some important customisation so for that we added some CSS from wp-admin→ Appearance → Customizer → add Custome CSS.
Its working great but now it's about more than 1000 lines of code so We are thinking to move it in any file inside the theme. So I was searched and found to add this CSS in WP-Customizer Plugin Custom.css file but after adding code to that our code is not working so please let us know how to make that code to some file inside the theme.
or any other way to put that code in a separate file inside the modern theme itself.
Hi,
In the modern theme there is a style.css file, you can add your custom css there.
If you want to add the custom css in wplms customizer plugin->custom.css file then first you'll have to add the bellow code in your wplms-customizer.php file and then the css will work fine:
add_action('wp_enqueue_scripts','wplms_customizer_custom_cssjs');
function wplms_customizer_custom_cssjs(){
wp_enqueue_style( 'wplms-customizer-css', plugins_url( 'css/custom.css' , __FILE__ ));
wp_enqueue_script( 'wplms-customizer-js', plugins_url( 'js/custom.js' , __FILE__ ));
}
This reply has been marked as private.
This reply has been marked as private.
Hi,
This code has no errors it just includes the files in the website.
Please try to copy the code in a notepad first and the copy the code from the notepad and then paste it in the plugin file.
This process will remove any html content which was copied with the code.
Let me know if this helps.
This reply has been marked as private.
Hi,
You said that this works on your staging website, this means that the code is correct.
This means the issue could be either you are not adding the code correctly in your live website or the function is already defined in your website.
To avoid the same function name in your website try adding the bellow code instead:
add_action('wp_enqueue_scripts',function(){
wp_enqueue_style( 'wplms-customizer-css2', plugins_url( 'css/custom.css' , __FILE__ ));
wp_enqueue_script( 'wplms-customizer-js2', plugins_url( 'js/custom.js' , __FILE__ ));
});
Thanks Mate, That is working for me :).