前提・実現したいこと
CSSやJSを正常に機能させたい。
発生している問題・エラーメッセージ
すみません、wordpress初心者です。
CSS,JSをfunctions.phpで読み込ませました。
すべて読み込みは出来ていると思いますが、
レスポンシブの確認をするために、ブラウザの幅を伸縮したところ、
フッター部にあるドロップダウンの部分がなぜか機能しなくなります。
(ワイド表示ではフッターはリストで表示され、縮めるとドロップダウン表示になるようにしています)
ブラウザをリロードすると元に戻りますが、ワイド表示にした後、スマホ表示に縮めるとまた同様の現象になります。
★エラーメッセージ
TypeError: e.indexOf is not a function
load jQuery
<匿名> http://gpc.main.jp/keigf/wp-content/themes/testsite/js/global.js?ver=20160608:145
TypeError: $(...).tabs is not a function
<匿名> http://gpc.main.jp/keigf/wp-content/themes/testsite/js/template.js?ver=20160608:209
jQuery 2
TypeError: $(...).size is not a function
<匿名> http://gpc.main.jp/keigf/wp-content/themes/testsite/js/template.js?ver=20160608:335
jQuery 2
TypeError: $(...).owlCarousel is not a function
<匿名> http://gpc.main.jp/keigf/wp-content/themes/testsite/js/global.js?ver=20160608:3
jQuery 2
TypeError: $(...).treeview is not a function
menuResponsive http://gpc.main.jp/keigf/wp-content/themes/testsite/js/template.js?ver=20160608:91
<匿名> http://gpc.main.jp/keigf/wp-content/themes/testsite/js/template.js?ver=20160608:137
jQuery 2
★警告
“http://gpc.main.jp/keigf/wp-content/themes/testsite/js/jstree.js?ver=20160608” からのスクリプトが読み込まれました。しかし、この MIME タイプ (“text/html”) は正しい JavaScript の MIME タイプではありません。
<script> のソース “http://gpc.main.jp/keigf/wp-content/themes/testsite/js/jstree.js?ver=20160608” の読み込みに失敗しました。
jQuery.Deferred exception: $(...).tabs is not a function @http://gpc.main.jp/keigf/wp-content/themes/testsite/js/template.js?ver=20160608:209:16
l@http://gpc.main.jp/keigf/wp-content/themes/testsite/js/jquery-3.3.1.min.js?ver=20160608:2:29375
a/</c<@http://gpc.main.jp/keigf/wp-content/themes/testsite/js/jquery-3.3.1.min.js?ver=20160608:2:29677
undefined
jQuery.Deferred exception: $(...).size is not a function @http://gpc.main.jp/keigf/wp-content/themes/testsite/js/template.js?ver=20160608:335:33
l@http://gpc.main.jp/keigf/wp-content/themes/testsite/js/jquery-3.3.1.min.js?ver=20160608:2:29375
a/</c<@http://gpc.main.jp/keigf/wp-content/themes/testsite/js/jquery-3.3.1.min.js?ver=20160608:2:29677
undefined
jQuery.Deferred exception: $(...).owlCarousel is not a function @http://gpc.main.jp/keigf/wp-content/themes/testsite/js/global.js?ver=20160608:3:29
l@http://gpc.main.jp/keigf/wp-content/themes/testsite/js/jquery-3.3.1.min.js?ver=20160608:2:29375
a/</c<@http://gpc.main.jp/keigf/wp-content/themes/testsite/js/jquery-3.3.1.min.js?ver=20160608:2:29677
undefined
### 該当のソースコード
<?php
// JS・CSSファイルを読み込む
function add_files() {
// WordPress提供のjquery.jsを読み込まない
wp_deregister_script('jquery');
// jQueryの読み込み
wp_enqueue_script('jquery-3.3.1.min', get_template_directory_uri().'/js/jquery-3.3.1.min.js', "", "20160608", false );
// サイト共通JS
wp_enqueue_script( 'jstree', get_template_directory_uri() .'/js/jstree.js', "", "20160608", false );
wp_enqueue_script( 'template', get_template_directory_uri() .'/js/template.js', "", "20160608", false );
wp_enqueue_script( 'scommon', get_template_directory_uri() .'/js/common.js', "", "20160608", false );
wp_enqueue_script( 'global', get_template_directory_uri() .'/js/global.js', "", "20160608", false );
// サイト共通のCSSの読み込み
wp_enqueue_style( 'style', get_template_directory_uri() . '/css/style.css', "", '20160608' );
wp_enqueue_style( 'bootstrap-4.3.1', get_template_directory_uri() . '/css/bootstrap-4.3.1.css', "", '20160608' );
wp_enqueue_style( 'font-awesome.min', get_template_directory_uri() . '/font-awesome/css/font-awesome.min.css', "", '20160608' );
wp_enqueue_style( 'ono', get_template_directory_uri() . '/css/ono.css', "", '20160608' );
wp_enqueue_style( 'webfont', get_template_directory_uri() . '/css/webfont.css', "", '20160608' );
wp_enqueue_style( 'responsive', get_template_directory_uri() . '/css/responsive.css', "", '20160608' );
}
add_action('wp_enqueue_scripts', 'add_files');
?>
<?php
// JSファイル追加の関数
function my_load_widget_scripts() {
// Twitterウィジェット用のJSの読み込み
wp_enqueue_script( 'popper.min', get_template_directory_uri() . '/js/popper.min.js', array());
// はてブボタン用のJSを読み込み
wp_enqueue_script('bootstrap-4.3.1', get_template_directory_uri() . '/js/bootstrap-4.3.1.js', array());
}
// wp_footerに処理を登録
add_action('wp_footer', 'my_load_widget_scripts');
?>
<?php
remove_action('wp_head','wp_generator');
?>
### 試したこと
header.phpとfooter.phpに直接CSSとJSを読み込ます設定をしたところ、
うまく表示されましたが、functions.phpに入力すると消えてしまいます。
### 補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。