Jcycle2渐进式加载和Wordpress高级自定义字段

时间:2016-04-13 14:37:47

标签: javascript php wordpress advanced-custom-fields jcycle

我试图让Jcycle2的渐进式加载脚本与我的ACF字段一起使用。 问题是,渐进式加载脚本是使用JSON,我不知道如何实现我的PHP。

来自Jcycle2网站:



<div class="cycle-slideshow auto" 
    data-cycle-fx=scrollHorz
    data-cycle-timeout=2000
    data-cycle-caption=".caption1"
    data-cycle-caption-template="{{slideNum}} / 9"
    data-cycle-loader=true
    data-cycle-progressive="#images"
    >
    <!-- only one image declared in markup -->
    <img src="http://malsup.github.io/images/beach1.jpg">

    <!-- 
        JSON array of slides to be loaded progressively,
        nested inside a script block.  The script block does not need
        to be inslide the slideshow container, it can be anywhere on the
        page.  Note the type on the script tag.
    -->
    <script id="images" type="text/cycle">
[
    "<img src='http://malsup.github.io/images/beach2.jpg'>",
    "<img src='http://malsup.github.io/images/beach3.jpg'>",
    ...
    "<img src='http://malsup.github.io/images/beach9.jpg'>"
]
</script>
</div>  
&#13;
&#13;
&#13;

我理想的是<script>部分成为我的ACF中继器的图像列表。这有可能吗?

0 个答案:

没有答案