【问题标题】:Navigation arrows in Woocommerce 3.x product gallery sliderWoocommerce 3.x 产品库滑块中的导航箭头
【发布时间】:2017-09-21 21:17:19
【问题描述】:
【问题讨论】:
标签:
woocommerce
flexslider
【解决方案1】:
您可以通过挂钩'woocommerce_single_product_carousel_options' 过滤器来更新 WooCommerce V3 中的 Flexslider 选项。因此,为了启用导航箭头,“directionNav”选项应设置为“true”。
把这个示例函数放在你的functions.php文件中,你应该很高兴:
// Update WooCommerce Flexslider options
add_filter( 'woocommerce_single_product_carousel_options', 'ud_update_woo_flexslider_options' );
function ud_update_woo_flexslider_options( $options ) {
$options['directionNav'] = true;
return $options;
}
【解决方案2】:
ul.flex-direction-nav {
position: absolute;
top: 30%;
z-index: 99999;
width: 100%;
left: 0;
margin: 0;
padding: 0px;
list-style: none;}
li.flex-nav-prev {float: left;}
li.flex-nav-next {float: right;}
a.flex-next {visibility:hidden;}
a.flex-prev {visibility:hidden;}
a.flex-next::after {visibility:visible;content: '\f105';
font-family: FontAwesome;margin-right: 10px;font-size: 70px; }
a.flex-prev::before {
visibility:visible;
content: '\f104';
font-family: FontAwesome; margin-left: 10px;font-size: 70px;}
【解决方案3】:
使用 woocommerce 3.5.3 获得更多测试价值
add_filter('woocommerce_single_product_carousel_options', 'ud_update_woo_flexslider_options');
function ud_update_woo_flexslider_options($options) {
// show arrows
$options['directionNav'] = true;
$options['animation'] = "slide";
// infinite loop
$options['animationLoop'] = true;
// autoplay (work with only slideshow too)
$options['slideshow'] = true;
//$options['autoplay'] = true;
// control par texte (boolean) ou bien par vignettes
// $options['controlNav'] = true;
//$options['controlNav'] = "thumbnails";
// $options['mousewheel'] = true;
return $options;
}