title: Change WooCommerce Product Name to Include Attribute When Attribute Selected
body: <p>I've referenced the answer from <a href="https://stackoverflow.com/questions/47462265/change-woocommerce-variable-product-title-based-on-variation">this question</a> which works perfectly!</p>
  
  <p>But I am displaying a product on the homepage using a <a href="https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-10" rel="nofollow noreferrer">woocommerce shortcode</a> and can't figure out how to adjust so it also applies to the homepage. </p>
  
  <p>I tried adjusting the line that selects only product pages to include the homepage, but it does not work:</p>
  
  <pre><code>    // Only single product pages
  if( ! is_product() &amp;&amp; ! is_home() ) return $title;
  </code></pre>
  
  <p>Any advice would be appreciated!</p>