この記事では、WordPressで推奨されている外部ファイルの読み込み方(wp_enqueue_scripts)について解説します。 当ブログテーマ(WADABLOG)は自作しましたが、実際に使用しています。簡単な上、WordPress開発では必ず使うので初心者必見です。 WordPressでCSS・JS ...
WordPressテーマでは、CSSやJSなどの外部ファイルをfunctions.phpで読み込むことが推奨されています。外部ファイルの読み込みにはwp_enqueue_style関数、wp_enqueue_script関数を呼び出すアクションフックを作成します。 wp_head関数でCSSとJSを読み込む 下記のようにfunctions ...
WordPressがなぜか遅い。キャッシュも使っているのに……そんなときは、あなたの作ったテーマのJavaScriptやCSSの読み込み方が ...
wp_enqueue_script is a fundamental function in WordPress used to manage and load JavaScript files efficiently. Understanding its purpose, core concepts, and use cases will help you manage scripts in ...
I'm getting the wrong uri's when I try to use wp_enqueue_style and wp_enqueue_script in a child theme. On 'wp_enqueue_scripts' I use 'get_stylesheet_directory_uri' to ...