Advertisement
Sykat

Untitled

Feb 5th, 2017
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.00 KB | None | 0 0
  1.  
  2. PASTEBIN
  3. new paste
  4. trends API tools faq
  5.  
  6. Guest User
  7. -
  8. Public Pastes
  9.  
  10.     Untitled2 sec ago
  11.     Untitled3 sec ago
  12.     Untitled5 sec ago
  13.     Untitled6 sec ago
  14.     Untitled10 sec ago
  15.     Untitled13 sec ago
  16.     Untitled18 sec ago
  17.     Untitled28 sec ago
  18.  
  19. SHARE
  20. TWEET
  21. Untitled
  22. a guest Feb 5th, 2017 77 Never
  23. Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  24. rawdownloadcloneembedreportprint text 1.09 KB
  25.  
  26.     <?php
  27.    if ( has_post_thumbnail() ) {
  28.         $image              = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
  29.         $image_title        = esc_attr( get_the_title( get_post_thumbnail_id() ) );
  30.         $image_link         = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID) );
  31.         $attachment_count   = count( $product->get_gallery_attachment_ids() );
  32.  
  33.         if ( $attachment_count > 0 ) {
  34.             $gallery = '[product-gallery]';
  35.         } else {
  36.             $gallery = '';
  37.         }
  38.         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 );
  39.  
  40.     } else {
  41.  
  42.         echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="Placeholder" class="bigbox" />', woocommerce_placeholder_img_src() ), $post->ID );
  43.  
  44.     }
  45. ?>
  46.  
  47.  
  48.     <?php do_action( 'woocommerce_product_thumbnails' ); ?>
  49.  
  50. RAW Paste Data
  51.     <?php
  52.    if ( has_post_thumbnail() ) {
  53.         $image              = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
  54.         $image_title        = esc_attr( get_the_title( get_post_thumbnail_id() ) );
  55.         $image_link         = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID) );
  56.         $attachment_count   = count( $product->get_gallery_attachment_ids() );
  57.  
  58.         if ( $attachment_count > 0 ) {
  59.             $gallery = '[product-gallery]';
  60.         } else {
  61.             $gallery = '';
  62.         }
  63.         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 );
  64.  
  65.     } else {
  66.  
  67.         echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="Placeholder" class="bigbox" />', woocommerce_placeholder_img_src() ), $post->ID );
  68.  
  69.     }
  70. ?>
  71.  
  72. <?php do_action( 'woocommerce_product_thumbnails' ); ?>
  73. create new paste  /  dealsnew!  /  api  /  trends  /  syntax languages  /  faq  /  tools  /  privacy  /  cookies  /  contact  /  dmca  /  advertise on pastebin  /  scraping  /  go
  74. Site design & logo © 2016 Pastebin; user contributions (pastes) licensed under cc by-sa 3.0 -- Dedicated Server Hosting by Steadfast
  75. My Pastebin
  76. My Messages
  77. My Alerts
  78. My Settings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement