Last active
March 6, 2018 14:51
-
-
Save dibakarjana/6c847753115be72f6c2dd6f813bebb06 to your computer and use it in GitHub Desktop.
Custom post type loop and taxonomy term as class
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 | |
$new = new WP_Query('post_type=property'); | |
while ($new->have_posts()) : $new->the_post(); ?> | |
<?php $terms = get_the_terms( $post->ID, 'location' ); ?> | |
<div class="element-item transition <?php foreach( $terms as $term ) echo ' ' . $term->slug; ?>" data-category="transition"> | |
<div class="name"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div> | |
</div> | |
<?php endwhile; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment