Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
WordPress Webサイトの1つのサイトにJavaScriptを挿入するにはどうすればよいですか?関数で実行できると読んだのですが、add_action('wp_head', 'function'); どういうわけかこれはうまくいきません。
add_action('wp_head', 'function');
ご協力いただきありがとうございます!phpheini
(テーマ内の)functions.phpファイルに関数を作成してから追加します。例えば、
function my_custom_javascript{ print("<script language = 'javascript'>alert('trying my javascript alerts');</script>"); ) add_action('wp_head', 'my_custom_javascript');