// I want newer articles at the end query_posts('order=ASC'); // If I have posts to display if (have_posts()): // This special order only applies to homepage if ( is_home() ) { $myOrderedPosts = array(); foreach ( $posts as $postIndex => $post ){ the_post(); $myPosition = get_post_meta($post->ID, "posizione", true); if ( !empty($myPosition) ) { $myOrderedPosts[$myPosition] = $post; } } ksort( $myOrderedPosts ); } else $myOrderedPosts = $posts; // Now I have ordered posts, I can display them (the Loop) foreach( $myOrderedPosts as $myPosition => $post ){ // This is an internal function that updates pointers for the_title, the_permalink, etc setup_postdata($post); // display article informations and content the_title(); }; endif;