'5',
'post_status'=>'publish',
);
$recent_posts = wp_get_recent_posts( $args );
for ( $i = 0; $i < 5; ++$i ) {
$recent = $recent_posts[ $i ];
/**
* If post has thumbnail image we display it as slide image
* else we display the default slider image
*/
$slideImageURL = has_post_thumbnail( $recent['ID'] ) ?
wp_get_attachment_url( get_post_thumbnail_id( $recent['ID'] ) )
: get_template_directory_uri().'/images/slider/' . ($i + 1) . '.jpg';
?>