0
我在WordPress和jwplayer中使用anythingslider。我在自定義帖子類型中有一個自定義字段,用於存儲視頻網址或嵌入代碼。Anythingslider jwplayer和WordPress循環?
這是循環我使用的是顯示從自定義字段中的視頻URL或嵌入代碼在滑塊
<ul id="slider">
<?php $the_slider = new WP_Query('post_type=product'); while($the_slider->have_posts()) : $the_slider->the_post(); ?>
<?php //if(has_post_thumbnail()) { ?>
<li>
<?php if( get_field('video_preview'))
{
echo get_field('video_preview');
}?>
</li>
<?php endwhile; ?>
</ul>
我需要一些如何包裹get_field到的javascript jwplayer它會是什麼樣子下面。我嘗試了幾種方法,但我認爲JavaScript也越來越循環,而不是工作。我如何創建一個循環來使用上面的代碼使用js?
<script type="text/javascript">
jwplayer("myElement").setup({
file: "http://www.example.com/video.mp4",
width: "100%",
height: "315px"
});
</script>