Last active
December 23, 2015 20:19
-
-
Save theodorocaliari/6688253 to your computer and use it in GitHub Desktop.
show custom taxonomy - http://stackoverflow.com/a/15505132 - reference
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 | |
function mostra(){ | |
//http://stackoverflow.com/a/15505132 - reference | |
global $post; | |
$taxonomies = get_object_taxonomies($post->post_type); | |
foreach ($taxonomies as $taxonomy) { | |
$terms = get_the_terms( $post->ID, $taxonomy ); | |
if ( !empty( $terms ) ) { | |
foreach ( $terms as $term ){ | |
$mostra = $term->name; | |
} | |
} | |
} | |
return $mostra; | |
} | |
$valor = mostra(); | |
if($valor == 'Novo'): ?> | |
<span class="novo"></span> | |
<?php elseif($valor == 'Flex'): ?> | |
<span class="flex"></span> | |
<?php else: ?> | |
<?php endif; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment