How to make slider show 4 recent news and news start from begining not from 4th

I’m thinking you are just missing a wp_reset_postdata() call after you foreach loop. Take a look at get_posts(), which is used by wp_get_recent_posts(), to see an example usage.

Besides that you do not need the if (have_posts()) and the_post(); in your widget code. But should make use of setup_postdata().


Edit:

Example:

$argum = array( 
    'numberposts' => $naujienu_sk
);
$recent_posts = wp_get_recent_posts( $argum );
foreach ( $recent_posts as $post ) {
    setup_postdata( $post );
    // code
}
wp_reset_postdata();

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