Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Миниатюра
- $thumb_url = get_the_post_thumbnail_url( get_the_ID(), "medium_large" );
- // Галлерея (ссылки через запятую)
- $images = get_field( "location_gallery", get_the_ID() );
- $images = is_array( $images ) ? $images : [];
- $images = array_map(
- function ( $image ) {
- return esc_url( $image["sizes"]["medium_large"] );
- },
- array_slice( $images, 0, 5 ) // Берем только 5 первых картинок
- );
- $images = implode( ',', $images );
- printf( '<img class="location__image" src="%s" data-hover-slides="%s" alt="">', $thumb_url, $images );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement