Created
December 11, 2012 04:53
-
-
Save johnbhartley/4255964 to your computer and use it in GitHub Desktop.
Custom Tax
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 | |
$query = new WP_Query(array('post_type' => 'custom-post-type')); | |
while ($query->have_posts()) : $query->the_post(); | |
$terms = get_the_terms( $post->id, 'custom-taxonomy' ); // registered custom taxonomy in custom post type | |
$term_description = array(); | |
$term_name = array(); | |
if($terms) | |
{ | |
foreach( $terms as $term ) { | |
$term_slug[] = $term->slug; // save the slugs in an array | |
$term_name[] = $term->name; // save the slugs in an array | |
} | |
} //end count terms conditional. | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment