Advertisement
eventsmanager

custom #_EVENTCATEGORIES template

Sep 8th, 2023
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2. /* @var $EM_Event EM_Event */
  3. $count_cats = count($EM_Event->get_categories()->categories) > 0;
  4. $categories_collections = array();
  5. if( $count_cats > 0 ){
  6. ?>
  7. <ul class="event-categories">
  8. <?php
  9. foreach($EM_Event->get_categories() as $EM_Category):
  10. array_push($categories_collections,$EM_Category->output("#_CATEGORYLINK"));
  11. endforeach;
  12. rsort($categories_collections );
  13. ?>
  14. <?php foreach($categories_collections as $EM_Category): ?>
  15. <li><?php echo $EM_Category; ?></li>
  16. <?php endforeach; ?>
  17. </ul>
  18. <?php
  19. }else{
  20. echo get_option ( 'dbem_no_categories_message' );
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement