Why is added media as 1 (media=“1”) if functions.php ordered:
wp_enqueue_style('myicons', 'https://cdn.jsdelivr.net/npm/@icon/elegant-icons@0.0.1-alpha.4/elegant-icons.min.css', array(), '', true);
Why is added media as 1 (media=“1”) if functions.php ordered:
wp_enqueue_style('myicons', 'https://cdn.jsdelivr.net/npm/@icon/elegant-icons@0.0.1-alpha.4/elegant-icons.min.css', array(), '', true);
The last parameter there is for media and it is a string. As stated from the docs…
Accepts media types like `'all'` , `'print'` and `'screen'` , or media queries like ‘(orientation: portrait)’ and ‘(max-width: 640px)’.
You are passing true
which is probably seen as the value 1
. Solution is to use it with a proper string and one of the values specified above.
I have validated again. If I set FALSE it will be just inserted media.
wp_enqueue_style('elegant_icons', 'https://cdn.jsdelivr.net/npm/@icon/elegant-icons@0.0.1-alpha.4/elegant-icons.min.css', array(), '', false);
It is not connected to the custom CSS. How to force: media=“all” inside a functions.php?
Pass “all” instead of false?
Can you send the whole line as inside WordPress it is posisble only TRUE, FALSE.
wp_enqueue_style('elegant_icons', 'https://cdn.jsdelivr.net/npm/@icon/elegant-icons@0.0.1-alpha.4/elegant-icons.min.css', array(), '', false);
If WordPress recently added the attribute media="1"
to its image tags as a part of its efforts to enhance lazy loading and improve page performance, how to disable as media as value 1 prevents responsive icon.
Just look up the WordPress function…
Notice the media attribute is a STRING not a boolean like True/False. Just put in “all” or leave it blank as the default value is “all”. This isn’t rocket science.
Thank you.