Support

Account

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

  • The true solution:

    $catslug = get_query_var( 'product_cat' );
    if(get_field('eref-' . $catslug . ''))
    	{
    		echo '<div><span>REF: ' . get_field('eref-' . $catslug . '') . '</span></div>';
    	}
    

    I hope it can help someone else in the future too!