Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active December 31, 2015 19:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amdrew/8037145 to your computer and use it in GitHub Desktop.
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
<?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 }
@C-Dark
Copy link

C-Dark commented Aug 16, 2014

Hi Sumobi. Please how can i display only sub-categories?

@C-Dark
Copy link

C-Dark commented Aug 22, 2014

No problem. I've resolved it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment