function solofolio_cyclereact_thumbs($attachments, $thumbs, $i) { $out = "<ul class='solofolio-cyclereact-thumbs' style='" . solofolio_cyclereact_thumbs_style($thumbs) . "'>"; foreach ($attachments as $id => $attachment) { $i++; $thumb = wp_get_attachment_image_src($id, 'thumbnail'); $medium = wp_get_attachment_image_src($id, 'medium'); $caption = solofolio_attachment_caption($attachment); $out .= "\n\t\t<li class='thumb'><a href='#" . $i . "'>\n\t\t\t\t<img src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='\n\t\t\t\t\t\t data-sizes='auto'\n\t\t\t\t\t\t data-srcset='\n\t\t\t\t\t\t " . $thumb[0] . " 1x,\n\t \t\t\t " . $medium[0] . " 2x'\n\t \t\t\t class='lazyload'>\n\t\t</a></li>\n\t\t"; } $out .= "\n\t</ul>"; return $out; }
case 'window': default: return 'vert-scroll vert-scroll-window'; break; } } } $output = "<div class='solofolio-vert-scroll-gallery'>"; if ($hasTitleSlide) { $output .= "\n\t\t<div class='solofolio-gallery-title solofolio-vertscroll-title' id='" . $i . "'>\n\t\t\t<h2>" . $galleryTitle . "</h2>\n\t\t\t<div>" . wpautop($galleryText) . "</div>\n\t\t</div>"; $i++; } foreach ($attachments as $id => $attachment) { $large = wp_get_attachment_image_src($id, 'large'); $xlarge = wp_get_attachment_image_src($id, 'xlarge'); $caption = solofolio_attachment_caption($attachment); $output .= "<div class='" . solofolio_vertscroll_container_classes($size) . "' style='max-width:" . $xlarge[1] . "px' id='" . $i . "'>"; $output .= "\n\t\t<img\n data-sizes='auto'\n data-srcset='\n " . $large[0] . " " . $large[1] . "w,\n " . $xlarge[0] . " " . $xlarge[1] . "w'\n class='lazyload'\n width=" . $xlarge[1] . "\n height=" . $xlarge[2] . "/>\n\t"; if ($captions != "false" && !empty($caption)) { $output .= "<p class='wp-caption-text'>" . $caption . "</p>"; } $output .= "</div>"; $i += 1; } $output .= "</div>"; add_action('wp_footer', 'sl_vertscroll_js'); if (!function_exists('sl_vertscroll_js')) { function sl_vertscroll_js() { wp_enqueue_style('solofolio-vertscroll', get_template_directory_uri() . '/css/vertscroll.css', null, constant('SOLOFOLIO_VERSION')); wp_enqueue_script('picturefill', get_template_directory_uri() . '/js/picturefill.js', array(), constant('SOLOFOLIO_VERSION'), true);