私のウェブサイトはCSSファイルを読み込んでいますが、jsは読み込んでいません。 私のheader.phpの:ワードプレスwp_enqueueはCSSを読み込んでいますが、jsはありません
<!doctype html>
<html class="no-js" lang="de-DE">
<head>
<meta charset="UTF-8">
<title>//</title>
<?php wp_head(); ?>
</head>
と私のfunctions.php:
<?php
function include_all() {
wp_enqueue_style('app', get_template_directory_uri() . '/css/app.css',false,'1.1','all');
//---
wp_deregister_script('jquery');
wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-2.2.4.min.js', array(), null, true);
//---
wp_enqueue_script('app', get_template_directory_uri() . '/js/app.js', array('jquery'), null, true);
}
add_action('wp_enqueue_scripts', 'include_all');
?>
私は自分自身のバージョンを使用してWordPressのjqueryのを無効にしたいが、そのだけCSSを読み込みます。これは、Wordpressにjs & cssを含めるための最良の方法ですか?
ご協力いただきありがとうございます。ご協力いただきありがとうございます。
not working sry:/ –
エンキューパラメータwp_enqueue_script($ handle、$ src、$ deps、$ ver、$ in_footer)を確認してください。 wp_register_script( 'app'、get_template_directory_uri()。 '/js/app.js')で正しく定義します。 wp_enqueue_script( 'app'); –