Hi
I Just tried to display a simple custom field from a taxanomy with this code:
<?php
$citrus = 'citrus';
$variablew2 = get_field('parftestinfo', $citrus);
echo $variablew2 . 'test';
?>
It just display “test” on the page, am I doing something wrong?
I included a picture with the taxanomy.
Try using the category’s ID:
$citrusID = 123;
$variablew2 = get_field( 'parftestinfo', 'category_' . $citrusID );
How to Get Values From a Taxonomy Term
Hi
Thank you for your answer, but it didn’t help unfortunately.
I tried creating a normal category and used this code:
<?php
$citrusID = 1420;
$variablew22 = get_field( 'parftestinfo', 'category_' . $citrusID );
echo $variablew22;
?>
But it is still not showing anything from the parftestinfo field.
Is the taxonomy of your term ‘category’? or are you using a custom taxonomy? If the term is a ‘category’ and that is the correct field name and term ID then what you’re doing should be working.
Hi
I tried with a normal category and used that ID and I also tried with a custom taxanomy, but no matter what, nothing is shown from that field.
I even tried creating more custom fields, but nothing is shown.
What version of ACF are you using?
Have you tried deactivating other plugins or changing themes?