Support

Account

Home Forums General Issues Howto Inject Category Slug into get_field Reply To: Howto Inject Category Slug into get_field

  • Solved. Thanks for your help John.

    My final code on content-product.php

    $categories = get_the_terms($post_id, 'product_cat');
    if(get_field('eref-' . $categories[0]->slug . ''))
    	{
    		echo '<div><span>REF: ' . get_field('eref-' . $categories[0]->slug . '') . '</span></div>';
    	}