title: Why am i getting this Fatal Error Message
body: <p>I wrote my own shortcode for woocommerce.</p>
  
  <p>The code works fine on content-single-product.php.
  Any other page though, and my site breaks. Why?</p>
  
  <pre><code>Fatal error: Call to a member function get_gallery_image_ids() on null in /mysite/wp-content/plugins/woocommerce/templates/single-product/product-thumbnails.php on line 27
  </code></pre>
  
  <p>This is the function i wrote:</p>
  
  <pre><code>/* My custom shortcode code*/
  function get_woocommerce_gallery_image_thumbnails ( $atts ) {
  
       // Buffer our contents
       ob_start();
  
       /* Line to get the gallery thumbnails */
  wc_get_template( 'single-product/product-thumbnails.php');
  
       // Return buffered contents
       return ob_get_clean();
  }
  
  add_shortcode( 'wc_get_thumbs', 'get_woocommerce_gallery_image_thumbnails' );
  </code></pre>