Last active
October 24, 2017 10:46
-
-
Save mrfoxtalbot/a2315aeabf3394465c6034af6cfc6de3 to your computer and use it in GitHub Desktop.
Cómo mostrar term meta con ACF en listados por categoría (archive)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$term_id = get_queried_object()->term_id; | |
$post_id = 'nombretaxonomia_'.$term_id; | |
$customfield = get_field('nombre_del_campo_acf', $post_id); | |
echo $customfield; | |
?> | |
// Es necesario la barra baja despues del nombre de la taxonomia, para concatenar el ID del termino correctamente | |
// Source https://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/ | |
// Gracias a Mauricio Gelves y a Roberto Tuñon por su ayuda en sacar esto |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment