Add active class to foundation 6 tabs while looping categories

Sure, you can use a counter. Just move your while loop a little higher. Something along these lines: <ul class=”tabs” data-tabs id=”example-tabs”> <?php // counter for ul.tabs $i=0; $bulletin_types = get_object_taxonomies( ‘bulletinboard’ ); foreach( $bulletin_types as $bulletin_type ) : $terms = get_terms( $bulletin_type ); foreach( $terms as $term ) : // increment each one $i++; … Read more

taxquery taxonomy get terms

so if $trips_list is the sample trips section, and you want the sample trips to only show trips with the same terms – you’d find the current trips term and argue that in your WP_Query. // this trips terms $tripTerms = wp_get_post_terms( get_the_ID(), ‘reisezweck’); // if each trip only has one term (as its a … Read more

Confused by get_the_terms to use in a new wp_query

$terms is an array of terms, so PHP doesn’t know what you mean when you say $terms->slug. With foreach, you’re iterating through this array. If you only care about the first element, you can simply use $slug = $terms[0]->slug;. This will get you in trouble when there are no terms, though, so you will want … Read more