WP Query – odd/even and post types
-
Hi,
I want that odd and even posts would be different post types in one loop. How can i make it work? Here is the test query, which i think should work with getting odd and even ones, but how can i attach different post type here?
$args( 'post_type' => 'TYPE' ); $query = new WP_Query( $args ); <?php while (have_posts()): the_post() ?> <?php if ($wp_query->current_post % 2 == 0): ?> odd <?php else: ?> even <?php endif ?> <?php endwhile ?>
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP Query – odd/even and post types’ is closed to new replies.