示例#1
0
$title = ( isset( $title ) ) ? $title : '';
$subtitle = ( isset( $subtitle ) ) ? $subtitle : '';
$image = ( isset( $image ) ) ? esc_url( $image ) : '';
$link = ( isset( $link ) ) ? esc_url( $link ) : '';
$slogan_position = ( isset( $slogan_position ) ) ? $slogan_position : '';
$button = ( isset( $button ) ) ? $button : '';
$button_class = ( isset( $button ) && $button != '' ) ? 'with_button' : 'no-button';
$button_style = ( isset( $button_style ) ) ? $button_style : '';
$title_color = ( isset( $title_color ) ) ? $title_color : '#000000';
$title_size = ( isset( $title_size ) ) ? $title_size : '24';
$subtitle_color = ( isset( $subtitle_color ) ) ? $subtitle_color : '#000000';
$subtitle_size = ( isset( $subtitle_size ) ) ? $subtitle_size : '15';

if ( $image != '' ) {
    $attachment_image_id = yit_plugin_get_attachment_id( $image );
    $attachment_image_info = yit_getimagesize( $image );
}

$animate_data   = ( $animate != '' ) ? 'data-animate="' . $animate . '"' : '';
$animate_data  .= ( $animation_delay != '' ) ? ' data-delay="' . $animation_delay . '"' : '';
$animate        = ( $animate != '' ) ? ' yit_animate' : '';
?>

<?php if ( $image != '' ) : ?>
        <div class="teaser-wrapper <?php echo esc_attr( $animate . $vc_css . ' '. $button_class ) ?>" <?php echo $animate_data ?>>
            <div class="image" >
                <img src="<?php yit_image( "id={$attachment_image_id}&size=teaser_widget&output=url" ) ?>">
                <div class="image_banner_inside" style="height: <?php echo $attachment_image_info[1] ?>px;">
                    <div class="image_banner_text <?php echo $slogan_position ?>">
                        <?php if( $link != '' && $button == '' ) : ?>
示例#2
0
 *
 * @package Yithemes
 * @author  Francesco Licandro <*****@*****.**>
 * @since   1.0.0
 */
if ($size == 'small') {
    $size = 'thumbnail';
}
$a_attrs = $img_attrs = $div_attrs = array();
$div_attrs['class'][] = "img_frame img_size_{$size}";
if ($lightbox == 'true' || $lightbox == 'false' && !empty($link)) {
    $is_link = true;
} else {
    $is_link = false;
}
$image_id = yit_plugin_get_attachment_id($url);
if ($image_id != 0) {
    list($image_url, $image_width, $image_height) = wp_get_attachment_image_src($image_id, $size);
    if (empty($width)) {
        $width = $image_width;
    }
    if (empty($height)) {
        $height = $image_height;
    }
    $img_attrs['src'] = $image_url;
    $a_attrs['href'] = $url;
} else {
    $img_attrs['src'] = $a_attrs['href'] = $url;
}
if (!empty($link) && $lightbox != 'true') {
    $a_attrs['href'] = $link;