Last active
December 31, 2015 19:59
-
-
Save amdrew/8037145 to your computer and use it in GitHub Desktop.
Output a list of EDD's terms (with links) from the 'download_category' taxonomy
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 | |
/** | |
* Output a list of EDD's terms (with links) from the 'download_category' taxonomy | |
*/ | |
function sumobi_list_edd_terms() { | |
$taxonomy = 'download_category'; // EDD's taxonomy for categories | |
$terms = get_terms( $taxonomy ); // get the terms from EDD's download_category taxonomy | |
?> | |
<ul class="download-categories"> | |
<?php foreach ( $terms as $term ) : ?> | |
<li> | |
<a href="<?php echo esc_attr( get_term_link( $term, $taxonomy ) ); ?>" title="<?php echo $term->name; ?>"><?php echo $term->name; ?></a> | |
</li> | |
<?php endforeach; ?> | |
</ul> | |
<?php } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Sumobi. Please how can i display only sub-categories?