jasonglisson
6/4/2014 - 8:10 PM

Wordpress: Query all content types except the currently viewed one

Wordpress: Query all content types except the currently viewed one

<?php 
	  $this_post = $post->ID;
    $args = array( 'post_type' => 'career', 'post__not_in' => array($this_post), 'posts_per_page' => 3 );
    $loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    the_title();
    echo '<div class="entry-content">';
    the_excerpt();
    echo '</div>';
endwhile; ?>