0

I have enqueue the styles in script using the following code.

function libload()
{
    wp_enqueue_style('style_file' , plugin_dir_url(__FILE__).'lib/plugin_styles.css' , array(), '', true);
    wp_enqueue_script('js_file',  plugin_dir_url(__FILE__).'lib/plugin_js.js', array(), null, true);
}

add_action('wp_enqueue_scripts','libload');

The css file is loading correct style files as well. But the styles are not appearing in the firebug inspect elements nor being applied to the page.

The css is the basic one simply a test css.

.addtogunbtn
{
    color:red;
}

but not being applied,.

1
  • I solved this problem by adding different name in the id section Jan 22, 2017 at 12:27

1 Answer 1

1

In wp_enqueue_style()'s 5th parameter is not boolean. Use following code:

function libload()
{
    wp_enqueue_style('style_file' , plugin_dir_url(__FILE__).'lib/plugin_styles.css');
    wp_enqueue_script('js_file',  plugin_dir_url(__FILE__).'lib/plugin_js.js', array(), null, true);
}

add_action('wp_enqueue_scripts','libload');
2
  • brother i have figure it out the problem was with file name,., thanks for your time any way Jan 22, 2017 at 12:26
  • 1
    Glad you can fix the problem. Jan 22, 2017 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.