Created
February 3, 2016 16:28
-
-
Save pablocattaneo/6907546cf18b14bc09e2 to your computer and use it in GitHub Desktop.
Devuelve todos los custom field que tengan la misma Key.
Return all custom fielnd with same key value.
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 | |
$listItem="keyName"; // EL nombre del custom field tal como está en adminstrador ejemplo: canción | |
$listItem = get_post_meta($post->ID, $listItem, false); // La propiedad false convierte la respuesta en array | |
foreach ($listItem as &$valor) { | |
echo $valor . "<br/>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment