我在 wordpress 网站中使用猫头鹰轮播,我想动态地使用网站 url 将主题 url 中的导航 imgs 添加到网站。 这是代码:
$(".home-slider-wrapper").owlCarousel({
autoplay: true,
autoplayHoverPause: false,
loop: true,
nav: true, // Show next and prev buttons
dots: false,
slideSpeed: 2500,
smartSpeed: 1000,
responsive: {
0: {
items: 1,
}
},
navText: [
'<img src="/assets/images/angel-left.svg" alt="angle left" class="owl-prev__img" width="16px" height="14px">',
'<img src="/assets/images/angel-right.svg" alt="angle right" class="owl-next__img" width="16px" height="14px">',
],
});
在 functions.php 中,我编写了动态获取站点 url 的代码,并且可以通过以下方式访问站点 url: siteURLData.root_url 并且工作正常。
也许很简单,但我想知道如何在 navText src 中使用“siteURLData.root_url”。
谢谢