Querying both pages and posts

Use get_posts() or filter 'pre_get_posts' on the front page.

Sample code for get_posts():

$my_post_array = get_posts( 
    array ( 
        'post_type' => array ( 'post', 'custom_type' ) 
    ) 
);

foreach ( $my_post_array as $post )
{
    // do something awesome …
}

There are also parameters for a custom order by meta fields and so on. A filter on 'pre_get_posts' can do the same and more. It is just not as easy to read.

error code: 523