• Could you please help me with this? I have custom loop to display events in current month. How should i display category of every event? I tried to use standard WordPress functions, but it didn’t show anything.

Viewing 1 replies (of 1 total)
  • Just remember that event category is a custom taxonomy called event-category, not the default category taxonomy:

    <?php $cats = wp_get_post_terms($event->ID, 'event-category');
    if ($cats) { ?>
        <ul>
           <?php foreach ($cats as $cat) { ?>
               <li>
                  <?php echo $cat->name; ?>
               </li>
            <?php } ?>
        </ul>
    <?php } ?>
    • This reply was modified 6 years, 9 months ago by Aitor Méndez.
Viewing 1 replies (of 1 total)
  • The topic ‘How to display event category name?’ is closed to new replies.