Conditionally Loading JavaScript and CSS in WordPress

It’s looks like kinda of cool thing, to have script that conditionally loading JavaScript and CSS in WordPress plugins or function. But, for the best way, in most flexible way, you don’t have to have script conditionally loading JavaScript and CSS, since browser in these day do cache the files from website that we visit. So if you have the same CSS on all pages, browser will get it only once. If there are many CSS files for different pages, browser will have to get all of them. So I wouldn’t do it at all, and include these CSS styles in global css file.

Artikel terkait:   Using Dashicons for WordPress Theme and Plugin

Isi Komentar

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

× six = fifty four

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top