Commit 9a8e881c authored by Nahla Shiri's avatar Nahla Shiri

Affichage phototèque

parent cf42abfc
......@@ -463,8 +463,22 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
}
if($current_page == 'phototheque'){
$nap_img = ' <a class = "circle-btn download-btn hidden-elem" download href="' . get_the_post_thumbnail_url($post_ID, 'full') . '"></a>';
$nap_img.= '<img class="transition" src="' . get_the_post_thumbnail_url($post_ID, 'thumbnail') . '" alt="" title="">';
$img = '';
if(has_post_thumbnail($post_ID))
{ $prod_image = get_the_post_thumbnail_url($post_ID, 'thumbnail');
$prod_hd = get_the_post_thumbnail_url($post_ID, 'full');
}
else {
$product = new WC_Product_Variable( $post_ID );
$variations = $product->get_available_variations();
if(isset($variations[0]))
{ $prod_image = get_the_post_thumbnail_url($variations[0]['variation_id'], 'thumbnail');
$prod_hd = get_the_post_thumbnail_url($variations[0]['variation_id'], 'full');
}
}
$nap_img = ' <a class = "circle-btn download-btn hidden-elem" download href="' . $prod_hd . '"></a>';
$nap_img.= '<img class="transition" src="' . $prod_image . '" alt="'. get_the_title($post_ID).'" title="'. get_the_title($post_ID).'">';
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment