title: I need some help on this code
body: <p>Can someone explain to me what exactly this code does? I'm especially confused at the 'Extra post classes' part. The only thing I'm trying to achieve is is that every 4th class gets an extra class.</p>
  
  <pre><code>global $product, $woocommerce_loop;
  
  $PHT_shopID = get_option('woocommerce_shop_page_id');
  $PHT_shopID = get_permalink($PHT_shopID);
  
  // Store loop count we're currently on
  if (empty($woocommerce_loop['loop'])) {
    $woocommerce_loop['loop'] = 0;
  }
  
  // Store column count for displaying the grid
  if (empty($woocommerce_loop['columns'])) {
    $woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 4 );
  }
  
  // Ensure visibility
  if (!$product || !$product-&gt;is_visible()) {
    return;
  }
  
  // Increase loop count
  $woocommerce_loop['loop']++;
  
  // Extra post classes
  $PHTclasses = array();
  if ( 0 === ( $woocommerce_loop['loop'] ) % $woocommerce_loop['columns'] || 1 === $woocommerce_loop['columns'] )
    $PHTclasses[] = 'first';
  if ( 0 === ($woocommerce_loop['loop'] ) % $woocommerce_loop['columns'] )
    $PHTclasses[] = 'last';
  
      $PHTclasses[] = 'primary-product-block';
  ?&gt;
  </code></pre>