PHP Code:
// the array of attributes names    $attribute_names = array('pa_merk');    foreach( $attribute_names as $key => $attribute_name ) {
        // Getting the value of an attribute        $attribute_value = array_shift(wc_get_product_terms( $product->id, $attribute_name));
        // Displays only if attribute exist for the product        if(!empty($attribute_value) || $attribute_value == '0' ){            echo $attribute_value; 
PHP Code:
<a class="product-loop-title" <?php echo $more_target ?> href="<?php echo esc_url$product->get_product_url() ) ?>" target="_blank" rel="nofollow">            <h3><?php the_title(); ?></h3>        </a>        <?php
Ik ben nu een paar uurtjes aan het klooien met de content-product pagina in woocommerce. I.p.v.de naam van een product, wil ik op de categorie pagina enkel het merk tonen met een affiliate link. Het is me met de bovenste code gelukt om het merk te tonen, maar de link toevoegen niet. Nu lukt het mij wel om deze link bij de naam toe te voegen, maar bij het attribuut (merk) niet. Wat is de juiste wijze?

Bovenste code is het tonen van het attribuut
Onderste code is hoe ik link heb toegevoegd bij de Title / Naam van het product