I’m currently trying to print a value from a sub field. I have the reapeater "faixas" that has the sub fields: "nome", "interprete" and "letra". On the custom fields area, I have the field "upc" that I print easily using echo('"'.get_field('upc').'";');
, but when I try to do the same with "nome, interprete and letra", they just don’t print. I already tried to print using echo('"'.get_sub_field('nome').'";');
, but it didn’t worked. I don’t know if I need to point the sub field for the faixas repeater, can please someone help me?
2
Answers
Looking for it I've found this solution:
For this answer I’m assuming you’re using ACF to store that repeater.
If that is the case, this should do the trick:
When getting a repeater, you receive an array of the rows inside it (which I store in
$faixas
in this example).In turn, each row is an associative array where the keys are the subfields’ names.
Hope this helps, keep on coding!