Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $query2 = new WP_Query( array( 'post_type' => 'events', 'paged' => $paged ) );
- if ( $query2->have_posts() ) : ?>
- <?php while ( $query2->have_posts() ) : $query2->the_post(); ?>
- <h1><?php the_title(); ?></h1>
- <?php
- //Platinum sponsors
- $platinum = new WP_Query( array(
- 'connected_type' => 'sponsors_to_event', // the name of your connection type
- 'connected_items' => $post,
- 'nopaging' => true,
- 'cat'=>18,
- ) );
- // Display connected sponsors
- if ( $platinum->have_posts() ) : ?>
- <?php while ( $platinum->have_posts() ) : $platinum->the_post(); ?>
- <?php the_title(); ?>
- <?php endwhile; ?>
- <?php
- // Prevent weirdness
- wp_reset_postdata();
- endif;
- //Platinum sponsors
- $gold = new WP_Query( array(
- 'connected_type' => 'sponsors_to_event',
- 'connected_items' => $post,
- 'nopaging' => true,
- 'cat'=>17,
- 'connected_direction' => 'any'
- ) );
- // Display connected sponsors
- if ( $gold->have_posts() ) : ?>
- <?php while ( $gold->have_posts() ) : $gold->the_post(); ?>
- <?php the_title(); ?>
- <?php endwhile; ?>
- <?php
- // Prevent weirdness
- wp_reset_postdata();
- endif;
- ?>
- <?php endwhile; wp_reset_postdata(); ?>
- <!-- show pagination here -->
- <?php else : ?>
- <!-- show 404 error here -->
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement