Posted By

clatterblast on 10/06/12


Tagged

php calendar events the


Versions (?)

Display Categories in your sidebar with The Events Calendar


 / Published in: PHP
 

I used this code to display a list of categories in my sidebar. There is an issue with this code — it shows ALL event categories. I am working on a solution to only display the categories for upcoming (future) events.

  1. <?php
  2. $taxonomy = 'tribe_events_cat';
  3. $orderby = 'name';
  4. $show_count = 0; // 1 for yes, 0 for no
  5. $pad_counts = 0; // 1 for yes, 0 for no
  6. $hierarchical = 1; // 1 for yes, 0 for no
  7. $title = '';
  8. $args = array(
  9. 'taxonomy' => $taxonomy,
  10. 'orderby' => $orderby,
  11. 'show_count' => $show_count,
  12. 'pad_counts' => $pad_counts,
  13. 'hierarchical' => $hierarchical,
  14. 'title_li' => $title,
  15. 'exclude' => array(**enter number(s) to exclude separated by commas**)
  16. );
  17. ?>
  18. <ul>
  19. <?php wp_list_categories($args); ?>
  20. </ul>

Report this snippet  

You need to login to post a comment.