Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="domtab cat-menu">
- <ul class="domtabs">
- <?php
- // Projects
- $c_projects = new WP_Query( array(
- 'connected_type' => 'event-project',
- 'connected_items' => get_queried_object_id(),
- 'posts_per_page' => -1,
- 'orderby' => '_order',
- 'order' => 'ASC'
- ) );
- // Artists
- $c_artists = new WP_Query( array(
- 'connected_type' => 'event-artist',
- 'connected_items' => get_queried_object_id(),
- 'posts_per_page' => -1,
- 'orderby' => '_order',
- 'order' => 'ASC'
- ) );
- // Merge connected projects & artists and split them into event-time
- $c_artists_projects = array_merge($c_projects->posts, $c_artists->posts);
- $buckets = p2p_split_posts($c_artists_projects, 'event-time' );
- foreach ( $GLOBALS['event-time'] as $type ) {
- if (!isset( $buckets[$type]) )
- continue;
- $bucket = $buckets[$type];
- echo '<li><a href="#'.$type.'">'.$type.'</a></li>';
- } ?>
- </ul>
- <?php foreach ($buckets as $type => $bucket) { ?>
- <div class="tab"><a name="<?php echo $type; ?>" id="<?php echo $type; ?>"></a>
- <?php foreach ($bucket as $post) {?>
- <div class="post-block">
- <h3><a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php the_title(); ?></a></h3>
- <?php if (get_post_type() == 'project') {
- $p_artists = new WP_Query( array(
- 'connected_type' => 'artist-project',
- 'connected_items' => $post,
- 'posts_per_page' => -1,
- 'orderby' => 'title',
- 'order' => 'ASC'
- ) );
- if ($p_artists->have_posts() ) :
- while ($p_artists->have_posts() ) : $p_artists->the_post(); ?>
- <h4><a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php the_title(); ?></a></h4>
- <?php endwhile;
- wp_reset_postdata();
- endif; ?>
- <?php } ?>
- <div class="taxonomies">
- <?php echo get_post_meta($post->ID, 'artistdesc', true); ?>
- </div>
- </div>
- <?php } ?>
- </div>
- <?php }
- wp_reset_postdata();
- wp_reset_query();
- $buckets = null; ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement