WordPress style doesn't work -


I was trying to include a style file in the WordPress plugin. This style needs to work on the front end but the code below is not working.

prefix function_name_script () {wp_register_style ('button', plugins_url ('include / parts / css / buttons.css')); Wp_enqueue_style ('button'); } Add_action ('wp_enqueue_scripts', 'theme_name_scripts');

What's the problem here? I have also tried all other Stackworphraphr ansers when I add styles directly to the theme style.css file then it works

Without the second argument, you do not have a directory of your plugin for the path / plugins directory, assume that the above is coming from a file in the root of your plugin, Can work:

  function topic_name_script () {wp_register_style ('button-style', plugins_url ('/ Includes parts /css/buttons.css', __FILE__)); Wp_enqueue_style ('button-style'); } Add_action ('wp_enqueue_scripts', 'theme_name_scripts');  

Comments