• Resolved radojica

    (@radojica)


    Hello!

    I’m using shortcode-download.php

    Is there a way I could display categories for each product listed with shortcode?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • We recommend using the [downloads] shortcode and defining the category you’d like to display on a given page.

    Thread Starter radojica

    (@radojica)

    Thanks for reply, but that is not what I asked actually.

    I would like to show name and link to each category in listed items.

    Plugin Support Daniel

    (@dgoldak)

    Sorry if we don’t quite understand your request, but do you want to display links to see the list of products in that category?

    If so, you could set the download shortcode on a page that displays products in that category as Keri recommend. Do this for each category. Then create links to each page.

    If not, please provide a more detailed description of what you are requesting so we can better assist.

    Thread Starter radojica

    (@radojica)

    Thanks for reply.
    I solved it this way:

    $post_id = get_the_ID();
     $terms = wp_get_post_terms( $post_id, 'download_category' ); 		
     foreach($terms as $term) { ?>
      <a class="edd-sc-category" href="'themes/category/<?php echo $term->slug; ?>">
        <?php echo isset($term->name) ? $term->name : ''; ?>
      </a>
    <?php } ?>

    But I was guessing that maybe there is some other way.

    Plugin Support Daniel

    (@dgoldak)

    Thanks for specifying what you did! There is no built in functionality to display the categories so it requires custom code as you created.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add categories into listed items’ is closed to new replies.