Created
April 20, 2017 23:12
-
-
Save alandbh/0d4c591565443e2121d92eddee523f1b to your computer and use it in GitHub Desktop.
It returns an array of terms objects given a taxonomy; // Retorna um array de objetos de termos de uma taxonomia
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
<pre> | |
<?php | |
$terms = get_terms([ | |
'taxonomy' => 'tipo', | |
'hide_empty' => false, | |
]); | |
print_r($terms); | |
?> | |
</pre> | |
<ul class="portfolio-filter text-center"> | |
<?php | |
foreach ($terms as $term ) { | |
$termNome = $term->name; | |
$termSlug = $term->slug; ?> | |
<li><a class="btn btn-default" href="#" data-filter=".<?php echo $termSlug; ?>"><?php echo $termNome; ?></a></li> | |
<?php } ?> | |
</ul><!--/#portfolio-filter--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment