我購買了HTML5的主題,我想將其轉換爲WordPress主題,所以我的結構是:WordPress的使用JavaScript給人錯誤
css
js
images
index.php
header.php
footer.php
function.php
comments.php
single.php
page.php
我說我的CSS樣式這種方式,因爲我不想enqeue它沒有工作的服務員
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/css/grid.css">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/css/style.css">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/css/jquery.fancybox.css">
和喜歡我的風格完美的工作 但是當涉及到js文件我也做了同樣的方式
<script src="<?php bloginfo('template_directory'); ?>/js/script.js"></script>
所以當我打開inxdex.php的網站工作像魅力工作的相同方式之前,我讓它的WordPress主題,但是當我去single.php查看一個職位 我的風格工作,但我的js isn' t將其控制檯說:像
Uncaught TypeError: $ is not a function or
jQuery is undefined
或
this version is deprecated
所以我必須做的,使其在single.php中工作,而它的工作原理上的index.php 在function.php做也是錯誤給我同樣的錯誤fe
wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.6', true);
所以我想辦法只是爲了讓single.php中看起來像正常一樣的index.php PS我把我的JS文件在這兩個mythem/JS /和WordPress/JS的目錄就可以在我的工作指標.PHP我的索引有
<script src="js/jquery.js"></script>
<script src="js/jquery-migrate-1.2.1.js"></script
和它的作品所以請有沒有一種方法,使這也適用的single.php 如果這是有幫助的我想提出一個網站發表文章裏面,我想成爲下WordPress的,因爲它更容易使用比創建一個網站從我購買的HTML主題,所以我只是想讓我的javascrpit文件在每個頁面上工作 在此先感謝