この記事では、WordPressで推奨されている外部ファイルの読み込み方(wp_enqueue_scripts)について解説します。 当ブログテーマ(WADABLOG)は自作しましたが、実際に使用しています。簡単な上、WordPress開発では必ず使うので初心者必見です。 WordPressでCSS・JS ...
Include the WP Enqueue class in your plugin, theme or child theme file or use an autoloader. You can read more about autoloading in the readme of wp-autoload. Add your scripts and styles as one array ...
スクロールせずに見えるコンテンツであるヘッダーに関するスタイル指定をしたheader.cssのみをwp_headで読み込み、その他はフッターのwp_footer関数にて読み込むようになっています。 なお、wp_register_styleとwp_enqueue_styleについては下記の記事で書いていますので、よかったら読んでみてください。