php - Wordpress loop for multiple custom post types -


looking way loop through multiple custom post types , 4 recent posts.

i have below doesn't quite work if 2 posts of same post type, it'll show recent rather showing recent of custom posts.

$args = array('post_type' => array('cs_trainee', 'cs_graduates', 'cs_pros', 'sd_trainee', 'sd_graduates'), 'posts_per_page' => 4, 'orderby' => 'menu_order', 'order' => 'asc'); $careers = new wp_query( $args ); 

thanks

just change query_posts parameters bit....

query_posts( array(  'post_type' => array( 'post', 'report', 'opinion', bookmark' ),  'cat' => 3,  'orderby' => 'date',  'order' => 'desc',  'showposts' => 5 )  ); 

that should take care of you.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -