Current File : /home/lastyfjz/dermalaserclinic.co.uk/wp-content/themes/cherie/sbi/item.php
<?php
/**
 * Smash Balloon Instagram Feed Item Template
 * Adds an image, link, and other data for each post in the feed
 *
 * @version 2.2 Instagram Feed by Smash Balloon
 *
 */

// Don't load directly
if ( ! defined( 'ABSPATH' ) ) {
	die( '-1' );
}
$classes = SB_Instagram_Display_Elements::get_item_classes( $settings, $offset );
$post_id = SB_Instagram_Parse::get_post_id( $post );
$timestamp = SB_Instagram_Parse::get_timestamp( $post );
$media_type = SB_Instagram_Parse::get_media_type( $post );
$permalink = SB_Instagram_Parse::get_permalink( $post );
$maybe_carousel_icon = $media_type === 'carousel' ? SB_Instagram_Display_Elements::get_icon( 'carousel', $icon_type ) : '';
$maybe_video_icon = $media_type === 'video' ? SB_Instagram_Display_Elements::get_icon( 'video', $icon_type ) : '';
$media_url = SB_Instagram_Display_Elements::get_optimum_media_url( $post, $settings, $resized_images );
$media_full_res = SB_Instagram_Parse::get_media_url( $post );
$sbi_photo_style_element = SB_Instagram_Display_Elements::get_sbi_photo_style_element( $post, $settings ); // has already been escaped
$media_all_sizes_json = SB_Instagram_Parse::get_media_src_set( $post, $resized_images );



/**
 * Text that appears in the "alt" attribute for this image
 *
 * @param string $img_alt full caption for post
 * @param array $post api data for the post
 *
 * @since 2.1.5
 */
$img_alt = SB_Instagram_Parse::get_caption( $post, sprintf( __( 'Instagram post %s', 'cherie' ), $post_id ) );
$img_alt = apply_filters( 'sbi_img_alt', $img_alt, $post );

/**
 * Text that appears in the visually hidden screen reader element
 *
 * @param string $img_screenreader first 50 characters for post
 * @param array $post api data for the post
 *
 * @since 2.1.5
 */
$img_screenreader = substr( SB_Instagram_Parse::get_caption( $post, sprintf( __( 'Instagram post %s', 'cherie' ), $post_id ) ), 0, 50 );
$img_screenreader = apply_filters( 'sbi_img_screenreader', $img_screenreader, $post );

global $i;


$i++;

if($i === 1 && $settings['imageres'] !== 'true' ) {
    $i = 2;
}

?>

<?php if($i === 1): ?>

<div class="art-big-image">

    <a class="art-inst-item" href="<?php echo esc_url( $permalink ); ?>" target="_blank">
        <img src="<?php echo esc_url( $media_full_res ); ?>" alt="<?php echo esc_attr( $img_alt ); ?>">
    </a>

</div>


<?php else: ?>

    <?php if($i === 2): ?>
        <div class="art-other-images">
    <?php endif; ?>

        <a class="art-inst-item" href="<?php echo esc_url( $permalink ); ?>" target="_blank">
            <img src="<?php echo esc_url( $media_full_res ); ?>" alt="<?php echo esc_attr( $img_alt ); ?>">
        </a>

<?php endif; ?>