1. Home
  2. Knowledge Base
  3. Advanced
  4. Segment Downloads by Category

Segment Downloads by Category

Place the following code in your page.php to segment downloads by category

<?php
$terms = get_terms( 'dlm_download_category' );
foreach ( $terms as $term ) {
	echo "<h2>" . $term->name . "</h2>";
	$slug = $term->slug;
	echo do_shortcode( "[downloads category='$slug']" );
}
?>

Did you know! Our Page Addon extension offers you a shortcode to list downloads, categories, tags, and show info pages about each of your resources.

Was this article helpful?

Related Articles

Start Protecting your WordPress Downloads

Protect, sell and track downloads on Wordpress... What are you waiting for?