| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Theme: Classic. |
| 5 |
* |
| 6 |
* @link https://plugins360.com |
| 7 |
* @since 1.0.0 |
| 8 |
* |
| 9 |
* @package Automatic_YouTube_Gallery |
| 10 |
*/ |
| 11 |
|
| 12 |
$player_width = ! empty( $attributes['player_width'] ) ? (int) $attributes['player_width'] . 'px' : '100%'; |
| 13 |
$columns = (int) $attributes['columns']; |
| 14 |
|
| 15 |
$params = array( |
| 16 |
'uid' => sanitize_text_field( $attributes['uid'] ), |
| 17 |
'loop' => (int) $attributes['loop'], |
| 18 |
'autoadvance' => (int) $attributes['autoadvance'], |
| 19 |
'player_title' => (int) $attributes['player_title'], |
| 20 |
'player_description' => (int) $attributes['player_description'] |
| 21 |
); |
| 22 |
|
| 23 |
$featured = $videos[0]; // Featured Video |
| 24 |
?> |
| 25 |
<div class="automatic-youtube-gallery ayg"> |
| 26 |
<?php the_ayg_search_form( $attributes ); ?> |
| 27 |
<ayg-theme-classic id="ayg-<?php echo esc_attr( $attributes['uid'] ); ?>" class="ayg-theme ayg-theme-classic" data-params='<?php echo wp_json_encode( $params ); ?>'> |
| 28 |
<div class="ayg-player"> |
| 29 |
<div class="ayg-player-container" style="max-width: <?php echo $player_width; ?>;"> |
| 30 |
<?php |
| 31 |
unset( $attributes['loop'] ); |
| 32 |
the_ayg_player( $featured, $attributes ); |
| 33 |
?> |
| 34 |
</div> |
| 35 |
<div class="ayg-player-caption"> |
| 36 |
<?php if ( ! empty( $attributes['player_title'] ) ) : ?> |
| 37 |
<h2 class="ayg-player-title"><?php echo esc_html( $featured->title ); ?></h2> |
| 38 |
<?php endif; ?> |
| 39 |
<?php if ( ! empty( $attributes['player_description'] ) ) : ?> |
| 40 |
<ayg-description class="ayg-player-description"><?php if ( ! empty( $featured->description ) ) echo wp_kses_post( ayg_get_player_description( $featured, $attributes ) ); ?></ayg-description> |
| 41 |
<?php endif; ?> |
| 42 |
</div> |
| 43 |
</div> |
| 44 |
<div class="ayg-videos ayg-gallery ayg-row"> |
| 45 |
<?php foreach ( $videos as $index => $video ) : |
| 46 |
$classes = array(); |
| 47 |
$classes[] = 'ayg-video'; |
| 48 |
$classes[] = 'ayg-video-' . $video->id; |
| 49 |
$classes[] = 'ayg-col'; |
| 50 |
$classes[] = 'ayg-col-' . $columns; |
| 51 |
if ( $columns > 3 ) $classes[] = 'ayg-col-sm-3'; |
| 52 |
if ( $columns > 2 ) $classes[] = 'ayg-col-xs-2'; |
| 53 |
|
| 54 |
if ( $video->id == $featured->id ) { |
| 55 |
$classes[] = 'ayg-active'; |
| 56 |
} |
| 57 |
?> |
| 58 |
<div class="<?php echo implode( ' ', $classes ); ?>"> |
| 59 |
<?php the_ayg_gallery_thumbnail( $video, $attributes ); ?> |
| 60 |
</div> |
| 61 |
<?php endforeach; ?> |
| 62 |
</div> |
| 63 |
<?php the_ayg_pagination( $attributes ); ?> |
| 64 |
</ayg-theme-classic> |
| 65 |
</div> |
| 66 |
|