0

I recognized that site is not responsive and media.css file is not working, i inspected with dev tools what kind of styles are included in header and i found that there is min version/css/media.min.css?ver=4.8.1, but i include media.css without min, What can be the problem that media.css is not working?

This is how i included my scripts and styles

function wpb_adding_scripts() {

    wp_deregister_script('jquery');
    wp_register_script('jquery', get_template_directory_uri().'/js/jquery.min.js', array(), null,true);
    wp_register_script('bootstrap_js', get_template_directory_uri().'/js/bootstrap.min.js', array(), null,true);
    wp_register_script('mixitup_js', get_template_directory_uri().'/js/mixitup.min.js', array(), null,true);
    wp_register_script('fancybox_js', get_template_directory_uri().'/js/fancybox/dist/jquery.fancybox.js', array(), null,true);
    wp_register_script('main_js', get_template_directory_uri().'/js/main.js', array(), null,true);

    wp_enqueue_script('jquery');
    wp_enqueue_script('bootstrap_js');
    wp_enqueue_script('main_js');

    wp_enqueue_style('bootstrap', get_template_directory_uri().'/css/bootstrap.min.css');
    wp_enqueue_style('style', get_template_directory_uri().'/style.css');
    wp_enqueue_style('media', get_template_directory_uri().'/css/media.css');

}

add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );   
0

/css/media.min.css?ver=4.8.1 is not indicative of a "min version". The filename of this CSS file is LITERALLY: 'media.min.css'. (Additionally the file is versioned with the ver parameter set to 4.8.1).

So atetmpting to enqueue:

wp_enqueue_style('media', get_template_directory_uri().'/css/media.css');

Will certainly fail, and should in fact be:

wp_enqueue_style('media', get_template_directory_uri().'/css/media.min.css');
  • and file should be as well renamed to media.min.css? – Andrew Aug 16 '17 at 10:51
  • If it is not, then (according to dev tools) you have something else including (not sure if successfully) a file called media.min.css – mayersdesign Aug 16 '17 at 10:53
  • i have file named media.css by not media.min.css – Andrew Aug 16 '17 at 11:05
  • There must still be a path based problem though, so firstly do a site wide search for "/css/media.min" in your IDE to find out where this minned file is being included – mayersdesign Aug 16 '17 at 11:07
0

You Forget to add .min. wp_enqueue_style('media', get_template_directory_uri().'/css/media.min.css');

0

I was having the same problem. I changed the handle name from media to mediaa, and it worked.

wp_enqueue_style('media', get_template_directory_uri().'/css/media.css');

to

wp_enqueue_style('mediaa', get_template_directory_uri().'/css/media.css');

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.