How to use wp_get_recent_posts with many post types?

Use post types as an array.

$args = array( 
    'numberposts' => '5', 
    'post_type'   => array('cpt1', 'cpt2', 'cptn') 
);
$recent_posts = wp_get_recent_posts( $args );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)