Show default content if custom WP_Query has no posts

You do that the same way like with regular posts:

if ( $recent->have_posts() )
{
    while($recent->have_posts())
    {
        $recent->the_post();
        // print posts
    }
}
else
{
    print 'no posts found';
}

Leave a Comment

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