Showing posts from 4 categories along with all latest posts

You must first do the 4 queries for selected categories and while looping through them remember the IDs. Save them in an array. Then when pulling latest posts just add the post__not_in parameter with all the IDs you want to exclude.

You need 4 queries that look somewhat like this:

    $args = array(
        'category_name' => 'category1'
    );
    $loop = new WP_Query($args);
    while ($loop->have_posts()) : $loop->the_post();
        //do something
        $excludeIDs[] = the_ID();
endwhile;
wp_reset_postdata();

and then one something like this:

    $args = array(
        'post__not_in' => $excludeIDs
    );
    $loop = new WP_Query($args);
    while ($loop->have_posts()) : $loop->the_post();
        //do something else
        $excludeIDs[] = the_ID();
endwhile;
wp_reset_postdata();

That should get you started. If you need any other help, just ask.

error code: 523