Skip to content

Instantly share code, notes, and snippets.

@hansent
Last active December 26, 2015 21:39
Show Gist options
  • Save hansent/7217557 to your computer and use it in GitHub Desktop.
Save hansent/7217557 to your computer and use it in GitHub Desktop.
<?php $events_loop = new WP_Query( array('post_type' => 'events', 'posts_per_page' => '0', 'orderby' => 'ASC' ) ); ?>
<?php while ( $events_loop->have_posts() ) : $events_loop->the_post(); ?>
<?php $feat_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'mediumsize' ); ?>
<?php
$locations_list = wp_get_post_terms($post->ID, 'locations', array("fields" => "slugs"));
$occurences_list = wp_get_post_terms($post->ID, 'occurences', array("fields" => "slugs"));
$disciplines_list = wp_get_post_terms($post->ID, 'disciplines', array("fields" => "slugs"));
$cls_name = $post->post_name;
$cls_locations = join(" ", $locations_list);
$cls_occurences = join(" ", $occurences_list);
$cls_disciplines = join(" ", $disciplines_list);
?>
<div class="event <?php echo "$cls_name $cls_locations $cls_occurences $cls_disciplines" ?>">
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment