如何解决使用导航将Wordpress Gallery简码转换为滑块
我创建了一个定制器功能,可以在其中添加图库。完美运作。但是现在我想增强它-由于用户向图库添加了大约30张图像,因此我想将其保留为一个不错的滑块。这是代码:
function featured_image_gallery_customize_register( $wp_customize ) {
if ( ! class_exists( 'CustomizeImageGalleryControl\Control' ) ) {
return;
}
$wp_customize->add_setting( 'featured_image_gallery',array(
'default' => array(),'sanitize_callback' => 'wp_parse_id_list',) );
$wp_customize->add_control( new CustomizeImageGalleryControl\Control(
$wp_customize,'featured_image_gallery',array(
'label' => __( 'Image Gallery Field Label' ),'section' => 'footer_settings','settings' => 'featured_image_gallery','type' => 'image_gallery',)
) );
}
add_action( 'customize_register','featured_image_gallery_customize_register' );
function the_featured_image_gallery( $atts = array() ) {
$setting_id = 'featured_image_gallery';
$ids_array = get_theme_mod( $setting_id );
if ( is_array( $ids_array ) && ! empty( $ids_array ) ) {
$atts['ids'] = implode( ',',$ids_array );
$atts['size'] = 'medium';
$atts['link'] = 'none';
$atts['columns'] = '6';
echo gallery_shortcode( $atts );
}
}
虽然6列很好,但我想具有自动播放功能和导航箭头。没有插件怎么办?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。