Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $do_not_duplicate = array();
- //get all categories then display all posts in each term
- $taxonomy = 'category';
- $param_type = 'category__in';
- $term_args=array(
- );
- $terms = get_terms($taxonomy,$term_args);
- if ($terms) {
- foreach( $terms as $term ) {
- $args=array(
- "$param_type" => array($term->term_id),
- 'connected_type' => 'posts_to_invitations',
- 'connected_items' => get_queried_object(),
- 'nopaging' => true,
- 'post_type' => 'post',
- 'post_status' => 'publish,draft',
- 'posts_per_page' => -1,
- 'post__not_in' => $do_not_duplicate,
- 'caller_get_posts'=> 1
- );
- $my_query = null;
- $my_query = new WP_Query($args);
- if( $my_query->have_posts() ) {
- $do_not_duplicate[] = get_the_ID(); ?>
- <?php
- while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <tr>
- <td><?php include (TEMPLATEPATH . '/contactfullname.php'); ?></td>
- <td><?php echo get_post_meta($post->ID, 'ecpt_position', true); ?></td>
- <td><?php echo p2p_get_meta( get_post()->p2p_id, 'table', true ); ?></td>
- <td><?php echo ' ' .$term->name;?></td>
- <td><?php echo p2p_get_meta( get_post()->p2p_id, 'confirmation', true ); ?></td>
- </tr>
- <?php
- endwhile;
- ?>
- <?php
- }
- }
- }
- wp_reset_query(); // Restore global post data stomped by the_post().
- ?>
Advertisement
Add Comment
Please, Sign In to add comment