Created
October 18, 2012 15:39
-
-
Save madysondesigns/3912634 to your computer and use it in GitHub Desktop.
Print taxonomy of WP post in loop
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
In functions.php: | |
function get_taxonomy() { | |
$taxonomy = wp_get_object_terms( $post->ID, '[taxonomy]', array("fields" => "names") ); | |
$taxonomy = $taxonomy[0]; | |
echo $taxonomy; | |
} | |
In the loop: | |
<?php get_taxonomy() ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment