title: Get product custom attributes to display them in WooCommerce product loop
body: <p>I'm working in a woocommerce site (Real Estate) and I don't get to show product custom attributes on my front shop page (Eg. Square meters, Rooms, Toilets, etc). I'm trying to use the code below but I can make it work. With the code I have I'm just able to show product ID but when it comes to attributes it only shows the word &quot;Array&quot; or just &quot;Nothing&quot; when I put the attributes IDs in the code.</p>
  <p>The is the code I have:</p>
  <pre><code>add_action('woocommerce_after_shop_loop_item_title', 'cstm_display_product_category', 5);
  
  function cstm_display_product_category()
  {
      global $product;
  
      $productAttribute = $product-&gt;get_id();
  
     //if(isset($productAttribute)){
         echo '&lt;div class=&quot;items&quot; style=&quot;color: #fff;&quot;&gt;&lt;p&gt;Output: ' . $productAttribute . '&lt;/p&gt;&lt;/div&gt;';
     //}
  }
  </code></pre>
  <p>You can see the output live <a href="https://hotpropertyweek.es/tienda/" rel="nofollow noreferrer">here</a></p>
  <p>Whatever help or guide you can give me to be able to achieve this, will be so much appreciated. I'm a noob in this matters.</p>
  <p>P.D. I'm inserting this code in my functions.php file.</p>
  <p>Wordpress is up to date.
  Woocommerce is up to date.</p>