I have created the following query in order to get several post types in a custom page, which so far works:
<?php $args = array( 'post_type' => array('things', 'people', 'post'), 'posts_per_page' => -1, ); $query = new WP_Query( $args ); $postcount = 0; ?> <?php if ($query->have_posts()) : ?> <?php while ($query->have_posts()) : $query->the_post(); ?> <?php the_title( '', '', true ); ?> <?php $count++; // Increase the count by 1 ?> <?php endwhile; endif; // END the Wordpress Loop ?> <?php wp_reset_query(); ?>
I want to have each post type with a class, or several classes. If it is a people custom post type, add the class people around. How can I do it?