Showing posts from different categories and from custom post type

If you are after on post from category a, one from category b, another form category c and then finally a custom post type – each of these would have to be a separate query.

Think of these as ‘secondary queries’ – (the primary query being what lands you on the home page). So you’ll want use seperate instances of WP_Query (see this related post).

E.g.

$post_from_cat_a  = new WP_Query(array( 
    'category__name' => array('a'), 
    'posts_per_page'=> 1
));
if( $post_from_cat_a->have_posts() ){
    while( $post_from_cat_a->have_posts() ): $post_from_cat_a->the_post();
         //Display output here
    endwhile;
}

$post_from_cat_b  = new WP_Query(array( 
    'category__name' => array('b'), 
    'posts_per_page'=> 1
));
if( $post_from_cat_b->have_posts() ){
  ...
  ...

etc. Don’t forget to call wp_reset_postdata(); at the end.

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduseduedueduedueduedueduedu