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,.

  • I solved this problem by adding different name in the id section – Inzmam ul Hassan Jan 22 '17 at 12:27
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');
  • brother i have figure it out the problem was with file name,., thanks for your time any way – Inzmam ul Hassan Jan 22 '17 at 12:26
  • 1
    Glad you can fix the problem. – Md. Mrinal Haque Jan 22 '17 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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