WordPressではカスタムフィールドの値で記事の順序を並び替えるといった複雑な並び替えもできます。
$args_customs = array(
'post_type' => 'custom_post',//投稿タイプを指定します
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_key' => 'start_date',//並び替えに利用したいカスタムフィールドのキーを指定します。
'orderby' => 'meta_value',//カスタムフィールドの値で並び替えるという宣言です。
'order' => 'DESC'//表示順を指定します。
);
$posts_customs = get_posts($args_customs);
foreach ($posts_customs as $custom) {
setup_postdata($custom);
?>
表示したい内容
<?php } ?>


