/** * Output thumbnails * * Generate Bootstrap styled thumbnails * @param array $args * @param array $imgs */ function thumbnails($args = array(), $imgs = array()) { $args = array_merge(array('echo' => TRUE, 'ul' => TRUE, 'span' => 3, 'lightbox' => TRUE, 'tooltip' => TRUE, 'timthumb' => FALSE, 'imgs' => array()), $args); $output = ''; if ($args['ul']) { $output = '<ul class="thumbnails">' . PHP_EOL; } $imgs = array_merge($args['imgs'], $imgs); foreach ($imgs as $img) { if (!is_array($img)) { $img = array('src' => $img); } $img = array_merge(array('href' => $img['src'], 'span' => $args['span'], 'title' => FALSE, 'full' => FALSE, 'caption' => FALSE), $img); if ($args['timthumb']) { $tt = timthumb(array('src' => $img['src'], 'span' => $img['span'], 'h' => 100 * $args['span'] - 30)); $img['full'] = timthumb(array('src' => $img['src'], 'wh' => TRUE)); if ($img['src'] == $img['href']) { $img['href'] = $tt; } $img['src'] = $tt; } $output .= '<li class="span' . $img['span'] . '">' . PHP_EOL; $output .= '<a href="' . $img['href'] . '" class="thumbnail" rel="'; if ($args['lightbox']) { $output .= ' lightbox'; } if ($args['tooltip']) { $output .= ' tooltip'; } $output .= '"'; if ($img['title']) { $output .= ' title="' . $img['title'] . '"'; } if ($img['full']) { $output .= ' data-full="' . $img['full'] . '"'; } $output .= '>' . PHP_EOL; $output .= '<img src="' . $img['src'] . '" />' . PHP_EOL; $output .= '</a>' . PHP_EOL; if ($img['caption']) { $output .= '<div class="caption">' . $img['caption'] . '</div>'; } $output .= '</li>' . PHP_EOL; } if ($args['ul']) { $output .= '</ul> <!-- .thumbnails -->' . PHP_EOL; } if ($args['echo']) { echo $output; } else { return $output; } }
function srcset($src, $w = 500, $h = 500, $zc = 1, $s = 1, $f = 0) { return 'src="' . timthumb($src, $w, $h, $zc, $s, $f) . '" ' . 'srcset="' . timthumb($src, $w, $h, $zc, $s, $f) . ' 1x, ' . timthumb($src, srcset_multiple($w, 1.5), srcset_multiple($h, 1.5), $zc, $s, $f) . ' 1.5x, ' . timthumb($src, srcset_multiple($w, 2), srcset_multiple($h, 2), $zc, $s, $f) . ' 2x ' . '" '; }
<?php } ?> </div> </div> <?php foreach ($marketPrices as $i => $mp) { ?> <div class="mp-food-type row"> <div class="col-md-4 pic-hold"> <img src="<?php echo timthumb($mp['image'][0], array('w' => 260, 'h' => 210, 'zc' => 1)); ?> " class="product-img" /> </div> <div class="col-md-8 mp-info" id="m-group<?php echo $i; ?> "> <p class="mp-item-header rtxt"><?php echo $mp['title']; ?> : <span class="wtxt"><?php echo $mp['tagline'];
foreach ($gallery['gallery'] as $item) { $n++; ?> <div class="col-md-4 gallery-item"> <a href="<?php echo $item['image']['sizes']['large']; ?> " data-lightbox="gallery-<?php echo $i; ?> " title="<?php echo $item['title']; ?> "> <img src="<?php echo timthumb($item['image']['sizes']['medium'], array('w' => 250, 'h' => 150, 'zc' => 1)); ?> " alt="<?php echo $item['image']['title']; ?> " /> </a> </div> <?php if ($n >= 3) { ?> </div><!-- end row --> <div class="row gallery-row"> <?php $n = 0;
<div style="clear:both;"></div> <div class="slidearea row"> <img id="lobstahh" alt="The Yankee Lobster" src="<?php echo get_template_directory_uri(); ?> /assets/images/lobstahh.png" /> <div id="owl-demo"> <?php $slides = get_field('slider'); ?> <?php foreach ($slides as $slide) { ?> <div class="item"><img src="<?php echo timthumb($slide['slide']['url'], array('w' => 960, 'h' => 580)); ?> " /></div> <?php } ?> </div> </div> <div class="navArrowHolder row"> <a class="col-md-1 navArrow prev"></a> <a class="col-md-1 col-md-offset-10 navArrow next"></a> </div>