示例#1
0
/**
 * Gallery Slider
 *
 * @since 1.3.0
 *
 * @param array $atts Standard WordPress shortcode attributes
 */
function themeblvd_shortcode_gallery_slider($atts)
{
    // This shortcode requires Theme Blvd Framework 2.4.2+
    if (version_compare(TB_FRAMEWORK_VERSION, '2.4.2', '<')) {
        return __('Your theme does not support the [gallery_slider] shortcode. You must be using a theme with Theme Blvd Framework 2.4.2+', 'themeblvd_shortcodes');
    }
    $default = array('ids' => '', 'size' => '', 'thumb_size' => 'square_smallest', 'interval' => '5000', 'pause' => 'true', 'wrap' => 'true', 'nav_standard' => 'false', 'nav_arrows' => 'true', 'nav_thumbs' => 'true');
    $atts = shortcode_atts($default, $atts);
    // Setup [gallery]
    $gallery = sprintf('[gallery ids="%s"]', $atts['ids']);
    // Remove ID's from $atts
    unset($atts['ids']);
    // Convert booleans
    foreach ($atts as $key => $value) {
        if ($value === 'true') {
            $atts[$key] = true;
        } else {
            if ($value === 'false') {
                $atts[$key] = false;
            }
        }
    }
    return themeblvd_get_gallery_slider($gallery, $atts);
}
示例#2
0
/**
 * Gallery slider
 *
 * @since 2.3.0
 *
 * @param string $gallery Optional gallery shortcode usage like [gallery ids="1,2,3,4"]
 * @param string $type Type of slider, supports nivo or standard
 * @param string $size Image crop size for attachment images
 */
function themeblvd_gallery_slider($gallery = '', $type = 'standard', $size = 'full')
{
    echo themeblvd_get_gallery_slider($gallery, $type, $size);
}