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
<ul id="filters"> | |
<li><a href="#" data-filter="*">Everything</a></li> | |
<?php | |
$terms = get_terms("category"); // get all categories, but you can use any taxonomy | |
$count = count($terms); //How many are they? | |
if ( $count > 0 ){ //If there are more than 0 terms | |
foreach ( $terms as $term ) { //for each term: | |
echo "<li><a href='#' data-filter='.".$term->slug."'>" . $term->name . "</a></li>\n"; |