Last active
August 29, 2015 14:11
-
-
Save bmoredrew/d43ebcaf7f01006ec8ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$catargs = array( | |
'type' => 'tribe_events', | |
'orderby' => 'name', | |
'order' => 'ASC', | |
'hide_empty' => 1, | |
'hierarchical' => 1, | |
'number' => 5, | |
'taxonomy' => 'tribe_events_cat', | |
'pad_counts' => false | |
); | |
$eventcats = get_categories( $catargs ); | |
foreach ($eventcats as $eventcat): | |
$catID = $eventcat->term_id; | |
echo $catID; //correct IDs show... | |
echo get_category_link('14'); // but empty output! | |
echo get_category_link('cooking-class'); //empty | |
echo get_category_link( $eventcat->term_id ); //also emtpy! | |
//var_dump on above just return 0! | |
?> | |
<a href=" <?php echo esc_url( get_category_link( $catID ) ); ?> "> | |
<img src="<?php echo get_template_directory_uri(); ?>/assets/img/category1.jpg" alt="illustration"> | |
<span class="category-name"> | |
<?php echo $eventcat->name; ?> | |
</span> | |
</a> | |
<?php | |
endforeach; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment