Last active
December 19, 2015 15:49
-
-
Save spigotdesign/5979056 to your computer and use it in GitHub Desktop.
Tribe event category query
This file contains hidden or 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 $terms = rwmb_meta( '', 'type=taxonomy&taxonomy=tribe_events_cat' ); ?> | |
<?php foreach ( $terms as $term ) { $ecat = $term->slug; $ename = $term->name; } ?> | |
<?php $efeed = new WP_Query( array( | |
'post_type' => 'tribe_events', | |
'tribe_events_cat' => $ecat, | |
'showposts' => 5, | |
)); | |
?> | |
// Note: rmwb_meta is very similar to WP's get_post_meta |
This file contains hidden or 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 $efeed = new WP_Query( array( | |
'post_type' => 'tribe_events', | |
'showposts' => 5, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'tribe_events_cat', | |
'field' => 'slug', | |
'terms' => $ecat, | |
) | |
) | |
)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue was the query was not pulling in child categories in version 1. Version 2 does.