Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PASTEBIN
- new paste
- trends API tools faq
- Guest User
- -
- Public Pastes
- Untitled2 sec ago
- Untitled3 sec ago
- Untitled5 sec ago
- Untitled6 sec ago
- Untitled10 sec ago
- Untitled13 sec ago
- Untitled18 sec ago
- Untitled28 sec ago
- SHARE
- TWEET
- Untitled
- a guest Feb 5th, 2017 77 Never
- Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- rawdownloadcloneembedreportprint text 1.09 KB
- <?php
- if ( has_post_thumbnail() ) {
- $image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
- $image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );
- $image_link = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID) );
- $attachment_count = count( $product->get_gallery_attachment_ids() );
- if ( $attachment_count > 0 ) {
- $gallery = '[product-gallery]';
- } else {
- $gallery = '';
- }
- echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="bigbox woocommerce-main-image zoom" title="%s" rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_title, $image ), $post->ID );
- } else {
- echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="Placeholder" class="bigbox" />', woocommerce_placeholder_img_src() ), $post->ID );
- }
- ?>
- <?php do_action( 'woocommerce_product_thumbnails' ); ?>
- RAW Paste Data
- <?php
- if ( has_post_thumbnail() ) {
- $image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
- $image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );
- $image_link = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID) );
- $attachment_count = count( $product->get_gallery_attachment_ids() );
- if ( $attachment_count > 0 ) {
- $gallery = '[product-gallery]';
- } else {
- $gallery = '';
- }
- echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="bigbox woocommerce-main-image zoom" title="%s" rel="prettyPhoto' . $gallery . '">%s</a>', $image_link[0], $image_title, $image ), $post->ID );
- } else {
- echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="Placeholder" class="bigbox" />', woocommerce_placeholder_img_src() ), $post->ID );
- }
- ?>
- <?php do_action( 'woocommerce_product_thumbnails' ); ?>
- create new paste / dealsnew! / api / trends / syntax languages / faq / tools / privacy / cookies / contact / dmca / advertise on pastebin / scraping / go
- Site design & logo © 2016 Pastebin; user contributions (pastes) licensed under cc by-sa 3.0 -- Dedicated Server Hosting by Steadfast
- My Pastebin
- My Messages
- My Alerts
- My Settings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement