Created
November 30, 2017 04:43
-
-
Save kamalinfo/693de8d40944ee75586b3747e772d634 to your computer and use it in GitHub Desktop.
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 | |
//for another category addd | |
$facility = get_terms('hotel_category',true); | |
$post_terms = wp_get_post_terms(get_the_id(),'hotel_category'); | |
$post_terms_ids = array(); | |
foreach( $post_terms as $item ){ | |
$post_terms_ids[] = $item->term_id; | |
} | |
$i = 1; | |
foreach( $facility as $item ): | |
if(in_array($item->term_id, $post_terms_ids)){ | |
$class = 'check'; | |
} else { | |
$class = 'close'; | |
} | |
?> | |
<span><i class="zmdi zmdi-<?php echo esc_attr( $class ); ?>"></i><?php echo esc_html( $item->name ); ?></span> | |
<?php | |
if($i % 4 == 0){ | |
echo '</div><!-- ./single-facility inner --><div class="single-facility">'; | |
} | |
?> | |
<?php | |
$i++; | |
endforeach; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment