Quite often I’ll see users requesting to output a list of categories within Easy Digital Downloads and link through to each one. Although there’s a widget provided by EDD to do this, if you have many categories, simply listing them out in the sidebar isn’t sufficient.
If you start with something simple, you can gradually build the HTML and style it accordingly with CSS to match your site’s design.
Categories in EDD are actually WordPress terms, which I think confuses a lot of people. WordPress categories themselves are actually a taxonomy themselves. The taxonomy that each term in EDD belongs to is called download_category. We’ll need to make use of WordPress’ get_terms() and get_term_link() functions to achieve what we’re after.
Simply copy and paste the following function into your child theme’s functions.php or a custom plugin you have created:
Then, you can run the function where you’d like it to display, such as a custom page template:
<?php echo sumobi_list_edd_terms(); ?>