【发布时间】:2020-05-30 07:20:02
【问题描述】:
我正在 Wordpress 中制作自定义模板。我曾经安装插件 Post Carousel – Post Grid, Filter & Masonry for WordPress 并在页面上添加一个简码。但是我经常收到一个错误,结果 js 坏了,carousel 不工作。简码在 Wordpress 页面构建器中完美运行。
错误:
jquery-3.5.1.min.js:2 jQuery.Deferred exception: jQuery(...).slick is not a function TypeError: jQuery(...).slick is not a function
at HTMLDocument.<anonymous> (http://test/magnetic-one-template-page/:274:37)
at e (https://code.jquery.com/jquery-3.5.1.min.js:2:30005)
at t (https://code.jquery.com/jquery-3.5.1.min.js:2:30307) undefined
S.Deferred.exceptionHook @ jquery-3.5.1.min.js:2
t @ jquery-3.5.1.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.5.1.min.js:2
c @ jquery-3.5.1.min.js:2
fireWith @ jquery-3.5.1.min.js:2
fire @ jquery-3.5.1.min.js:2
c @ jquery-3.5.1.min.js:2
fireWith @ jquery-3.5.1.min.js:2
ready @ jquery-3.5.1.min.js:2
B @ jquery-3.5.1.min.js:2
这是我的头文件
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="<?php echo get_theme_file_uri( '/assets/css/code_test-style.css' ); ?>">
<script src="https://kit.fontawesome.com/71fcadc668.js" crossorigin="anonymous"></script>
<script src="https://npmcdn.com/flickity@2/dist/flickity.pkgd.js"></script>
<script
src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://npmcdn.com/flickity@2/dist/flickity.css">
在关闭body标签之前
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
有什么想法吗?
【问题讨论】:
标签: javascript html jquery css wordpress