Created
March 6, 2019 15:17
-
-
Save taciara/1d16e4cd462a7cff57fcaa90d3606e16 to your computer and use it in GitHub Desktop.
Dar echo em uma taxonomia dentro de uma página/single....
This file contains 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 // colocar isso após o if(have_posts()):the_post(); | |
$termsAutor = get_the_terms( get_the_ID(), 'NOMEDATAXONOMIA' ); | |
$autor = ''; | |
if ( $termsAutor && ! is_wp_error( $termsAutor ) ) { | |
foreach ( $termsAutor as $term ) { | |
if ( 0 == $term->parent ) { | |
$autor = $term->name; | |
} else {} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment