Custom wordpress SQL statement for a website

I think this could be life saver for you .
This is a simple function for creating multiple loops. It retrieves a list of latest posts or posts matching criteria.

<?php $posts_array = get_posts( $args ); ?>




<?php $args = array(
    'numberposts'     => 5,
    'offset'          => 0,
    'category'        => ,
    'orderby'         => 'post_date',
    'order'           => 'DESC',
    'include'         => ,
    'exclude'         => ,
    'meta_key'        => ,
    'meta_value'      => ,
    'post_type'       => 'post',
    'post_mime_type'  => ,
    'post_parent'     => ,
    'post_status'     => 'publish' ); ?>

for exclude categories try adding a minus sign in front of category id.

error code: 523