Can not enqueue .css for mobiles and tablets
-
Hi Scott! Thank you for the great plugin! It really helped me out in many cases except for one. I can not enqueue additional .css for mobiles and tablets. ( need to disable parallax effects for them)
I open functions.php where i have the section with the following code
add_action('wp_enqueue_scripts', 'heal_cc_script'); if(!function_exists('heal_cc_script')) { function heal_cc_script(){ wp_enqueue_style('bootstrap', CC_CSS .'bootstrap.min.css' ); wp_enqueue_style('style', CC_CSS .'style.css' );
…ETC
I add
if (is_mobile() && is_tablet()){ function luck() { wp_enqueue_style('noparallax', get_template_directory_uri() . '/style/noparallax.css'); } }
after the closing brackets of the previous function and also add ” ‘luck’ in add_action like this:
add_action('wp_enqueue_scripts', 'heal_cc_script');
noparallax.css definetly works and is placed in /root/style folder.
After updating nothing happens, however.( What am I doing wrong?
Can you give me an example of functioning code, please?Thank You!
PS I also tried to enqueue stye within existing function after all the original .css files before the closing brackets but that led to site crash.
- The topic ‘Can not enqueue .css for mobiles and tablets’ is closed to new replies.