images/prev.png"> <p class="[ span xmall-12 ][ text-center ][ no-margin ]"> <a class="[ block ][ padding ][ bg-transparent ][ js-gallery-toggler ]" data-modal="contacto" href="#"> Cerrar </a> </p> <img class="[ span ][ padding ][ cycle-control cycle-next ]" src="<?php echo THEMEPATH; ?> images/next.png"> </div> </div> <div class="[ modal-content ][ wrapper ][ text-center ]"> <div class="[ slideshow ]"> <?php $images = sga_gallery_images('full', $galleryIDs); $totalImages = count($images); foreach ($images as $key => $image) { $imageURL = $image[0]; ?> <img class="[ image-single ]" src="<?php echo $imageURL; ?> "> <?php } ?> </div><!-- slideshow --> <p class="[ text-center ][ no-margin ][ cycle-info ][ color-secondary ][ center-bottom ]"></p>
?> <!-- ================================================= ==== HERO ================================================== --> <?php $imagenes_home = get_page_by_title("Imágenes home"); global $sga_gallery_types, $post, $sga_options, $sga_gallery_params, $content; $post_id = $imagenes_home->ID; $gallid = $imagenes_home->ID; $howmany = preg_match_all('/\\[gallery(\\s+columns="[^"]*")?(\\s+link="[^"]*")?\\s+ids="([^"]*)"\\]/', $imagenes_home->post_content, $arrmatches); $imagenes_home_array = array(); $ids = $arrmatches[3][0]; // gallery images IDs are here now $images = sga_gallery_images('full', $ids); foreach ($images as $image) { array_push($imagenes_home_array, $image[0]); } $imagen_home = $imagenes_home_array[mt_rand(0, count($imagenes_home_array) - 1)]; ?> <section class="[ hero ]" style="background-image: url(<?php echo $imagen_home; ?> )"> <div class="[ opacity-gradient--top-bottom ][ z-index-2 ]"></div> <div class="[ text-center ][ center-bottom ][ z-index-2 ][ xmall-12 ]"> <div class="wrapper"> <a href="<?php echo site_url('archivo');
function get_galleries_from_content($post) { $content = $post->post_content; $post_id = $post->ID; $gallid = $post->ID; $galleries = array(); $howmany = preg_match_all('/\\[gallery(\\s+columns="[^"]*")?(\\s+link="[^"]*")?\\s+ids="([^"]*)"\\]/', $content, $arrmatches); for ($gallid = 0; $gallid < $howmany; $gallid++) { $gall = ''; // Reset gallery buffer $res = preg_match('/\\s*columns="([0-9]+)"/', $arrmatches[1][$gallid], $arrcolmatch); $ids = $arrmatches[3][$gallid]; // gallery images IDs are here now $images = sga_gallery_images('full', $ids); $galleries[] = $ids; } // Foreach loop on galleries return $galleries; }