title: Modification to WooCommerce for WordPress featured image link
body: <p>I need to change the link code that is being used for external products for woo commerce.</p>
  
  <p>This is the code that generates the product image:</p>
  
  <pre><code>&lt;?php
  /**
   * Single Product Image
   *
   * @author      WooThemes
   * @package     WooCommerce/Templates
   * @version     2.0.3
   */
  
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  
  global $post, $woocommerce;
  
  ?&gt;
  &lt;div class="images"&gt;
  
      &lt;?php
          if ( has_post_thumbnail() ) {
  
              $image              = get_the_post_thumbnail( $post-&gt;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_url( get_post_thumbnail_id() );
          $attachment_count   = count( get_children( array( 'post_parent' =&gt; $post-&gt;ID, 'post_mime_type' =&gt; 'image', 'post_type' =&gt; 'attachment' ) ) );
  
          if ( $attachment_count != 1 ) {
              $gallery = '[product-gallery]';
          } else {
              $gallery = '';
          }
  
          echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '&lt;a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s"  rel="prettyPhoto' . $gallery . '"&gt;%s&lt;/a&gt;', $image_link, $image_title, $image ), $post-&gt;ID );
  
      } else {
  
          echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '&lt;img src="%s" alt="Placeholder" /&gt;', woocommerce_placeholder_img_src() ), $post-&gt;ID );
  
      }
  ?&gt;
  
  &lt;?php do_action( 'woocommerce_product_thumbnails' ); ?&gt;
  </code></pre>
  
  <p></p>
  
  <p>So I just want to change out the image link to the external link url so if someone clicks on the picture, they will go to the external link instead of a blow up of the image</p>
  
  <p>The code to do so is within the add to cart code, but I don't know how to apply it to the image:</p>
  
  <pre><code>&lt;?php
  /**
   * Loop Add to Cart
   *
   * @author      WooThemes
   * @package     WooCommerce/Templates
   * @version     1.6.4
   */
  
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  
  global $product;
  ?&gt;
  
  &lt;?php if ( ! $product-&gt;is_in_stock() ) : ?&gt;
  
      &lt;a href="&lt;?php echo apply_filters( 'out_of_stock_add_to_cart_url', get_permalink( $product-&gt;id ) ); ?&gt;" class="button"&gt;&lt;?php echo apply_filters( 'out_of_stock_add_to_cart_text', __( 'Read More', 'woocommerce' ) ); ?&gt;&lt;/a&gt;
  
  &lt;?php else : ?&gt;
  
  &lt;?php
      $link = array(
          'url'   =&gt; '',
          'label' =&gt; '',
          'class' =&gt; ''
      );
  
      $handler = apply_filters( 'woocommerce_add_to_cart_handler', $product-&gt;product_type, $product );
  
      switch ( $handler ) {
          case "variable" :
              $link['url']    = apply_filters( 'variable_add_to_cart_url', get_permalink( $product-&gt;id ) );
              $link['label']  = apply_filters( 'variable_add_to_cart_text', __( 'Select options', 'woocommerce' ) );
          break;
          case "grouped" :
              $link['url']    = apply_filters( 'grouped_add_to_cart_url', get_permalink( $product-&gt;id ) );
              $link['label']  = apply_filters( 'grouped_add_to_cart_text', __( 'View options', 'woocommerce' ) );
          break;
          case "external" :
              $link['url']    = apply_filters( 'external_add_to_cart_url', get_permalink( $product-&gt;id ) );
              $link['label']  = apply_filters( 'external_add_to_cart_text', __( 'Read More', 'woocommerce' ) );
          break;
          default :
              if ( $product-&gt;is_purchasable() ) {
                  $link['url']    = apply_filters( 'add_to_cart_url', esc_url( $product-&gt;add_to_cart_url() ) );
                  $link['label']  = apply_filters( 'add_to_cart_text', __( 'Add to cart', 'woocommerce' ) );
                  $link['class']  = apply_filters( 'add_to_cart_class', 'add_to_cart_button' );
              } else {
                  $link['url']    = apply_filters( 'not_purchasable_url', get_permalink( $product-&gt;id ) );
                  $link['label']  = apply_filters( 'not_purchasable_text', __( 'Read More', 'woocommerce' ) );
              }
          break;
      }
  
      echo apply_filters( 'woocommerce_loop_add_to_cart_link', sprintf('&lt;a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="%s button product_type_%s"&gt;%s&lt;/a&gt;', esc_url( $link['url'] ), esc_attr( $product-&gt;id ), esc_attr( $product-&gt;get_sku() ), esc_attr( $link['class'] ), esc_attr( $product-&gt;product_type ), esc_html( $link['label'] ) ), $product, $link );
  
  ?&gt;
  </code></pre>
  
  
  
  <p>Sorry I'm such a nube, but I can't figure out how to get the link code the same as the 'add to cart' link code, thanks for the help!</p>