高级自定义字段库和Flex滑块

时间:2019-04-30 作者:Draws Ren Gundam

我想使用Flexslider显示库,如教程中所示:

https://www.advancedcustomfields.com/resources/gallery/

因此,我访问了Flexslider站点并遵循以下步骤:

https://woocommerce.com/flexslider/

我应该把这个代码放在哪里?

<!-- Place somewhere in the <head> of your document -->
<link rel="stylesheet" href="flexslider.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="jquery.flexslider.js"></script>
我试着上传flexslider。css文件和和jquery。flexslider。js通过FTP连接到我网站的根文件夹,然后我转到标题。我的主题(Divi)的php文件,我这样调用它们:

<?php wp_head(); ?>
<!-- Place somewhere in the <head> of your document -->
<link rel="stylesheet" href="http://electives-abroad.org/flexslider.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://electives-abroad.org/jquery.flexslider.js"></script>
</head>
结果是,我没有得到滑块,我的网站的所有图片都消失了。如何才能正确执行?

更新

这就是我将代码放在标题上时发生的情况。php,我网站上的大多数图片都不可见,控制台会抛出以下内容:

Uncaught TypeError: n(...).on is not a function
    at Object.<anonymous> (n2.min.js?1552618971:1)
    at n2.min.js?1552618971:1
    at N2Deferred._doCallbacks (n2.min.js?1552618971:1)
    at N2Deferred.resolve (n2.min.js?1552618971:1)
    at s (n2.min.js?1552618971:1)
    at N2Deferred._doCallbacks (n2.min.js?1552618971:1)
    at N2Deferred.resolve (n2.min.js?1552618971:1)
    at n2.min.js?1552618971:1
    at N2Deferred._doCallbacks (n2.min.js?1552618971:1)
    at N2Deferred.then (n2.min.js?1552618971:1)
custom.js?ver=5.1.1:162 Uncaught TypeError: SFSI(...).on is not a function
    at custom.js?ver=5.1.1:162
custom.js?ver=3.0.65:1318 Uncaught TypeError: $(...).on is not a function
    at custom.js?ver=3.0.65:1318
    at custom.js?ver=3.0.65:1418
smartslider-frontend.min.js?1552619634:1 Uncaught TypeError: this.sliderElement.on is not a function
    at t.SmartSliderAbstract.onSliderHasDimension (smartslider-frontend.min.js?1552619634:1)
    at Object.g (jquery.min.js:16)
    at Object.resolveWith (jquery.min.js:16)
    at Object.done (jquery.min.js:16)
    at t.SmartSliderAbstract.waitForDimension (smartslider-frontend.min.js?1552619634:1)
    at t.SmartSliderAbstract.onSliderExists (smartslider-frontend.min.js?1552619634:1)
    at Object.g (jquery.min.js:16)
    at Object.resolveWith (jquery.min.js:16)
    at Object.resolve (jquery.min.js:16)
    at s (smartslider-frontend.min.js?1552619634:1)
VM212:1 Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

1 个回复
最合适的回答,由SO网友:Harsh 整理而成

我认为您使用的是高级自定义字段的免费版本,在免费版本中,没有用于gallery字段的选项。你必须购买gallery插件,否则请购买advance custom field pro版本。

相关推荐

Post gallery as carousel

因此,我有一个想法:我想创建自定义页面模板,无论何时post gallery中的标签之间,例如:Lorem ipsum somethinginkgsd.... [carousel] Gallery here [/carousel] 我想把这个画廊改成旋转木马。我想创建旋转木马相当简单。我只需要像get\\u post\\u gallery\\u images这样的东西,但是:get\\u post\\u gallery\\u图像将只返回post中的第一个gall