Skip to content

Instantly share code, notes, and snippets.

@kaweski
Created November 17, 2016 18:13
Show Gist options
  • Save kaweski/9a985b50fac9517240cd34e1488e6830 to your computer and use it in GitHub Desktop.
Save kaweski/9a985b50fac9517240cd34e1488e6830 to your computer and use it in GitHub Desktop.
Tabela de Medidas usando fancybox.
<?php
/**
*
* Tabela de Medidas
*
*/
$images = foundation_q_get_option('website_table_sizes');
$images = explode(",", $images); // Transforma a lista de IDs em um array
foreach( $images as $image )
$images_array[] = (int)$image;
$first = true;
foreach ($images_array as $image):
$thumb_url = wp_get_attachment_image_src( $image, 'full', false );
if ( $first ): ?>
<a rel="tabela-de-medidas" href="<?php echo $thumb_url[0]; ?>" class="btn btn-link fancybox">Tabela de Medidas</a>
<?php
$first = false;
else: ?>
<a rel="tabela-de-medidas" href="<?php echo $thumb_url[0]; ?>" class="fancybox"></a>
<?php
endif;
endforeach; ?>
array(
'id' => 'website_table_sizes',
'type' => 'gallery',
'title' => 'Tabela de Medidas',
'subtitle' => '',
'desc' => '',
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment