2017-03-06 11 views
0

私はACFプロの日付&の時間ピッカーを使用して、カスタムの投稿タイプの「フィクスチャ」のフィールド「fixture_date」を設定しています。 new wp_Queryを実行するとすべての投稿が返されますが、カスタムフィールドの日付&の時間で並べ替えることはできません。ワードプレスの投稿をACFの日付と時刻のピッカーで並べ替える

時刻&時刻ピッカーは、ACF Pro内からj F Y - g:i aと出力するように設定されています。これまで

マイコード:私は何も変わっていないしました

<table id="fixturestable"> 
    <tbody> 
     <?php $args = array( 
      'post_type' => 'fixtures', 
      'posts_per_page' => -1, 
      'orderby' => 'meta_value', 
      'meta_key' => 'fixture_date', 
      'order' => 'ASC', 
      'meta_type' => 'DATETIME' 
      ); 

      $fixturesloop = new WP_Query($args); if ($fixturesloop->have_posts()):?> 
      <?php while ($fixturesloop->have_posts()) : $fixturesloop->the_post();?> 
       <tr> 
        <td class=""><?php the_title(); ?></td> 
        <td class=""><?php echo(get_field('fixture_date'));?></td> 
        <td class=""><?php echo(get_field('competition'));?></td> 
        <td class=""><?php echo(get_field('venue'));?></td> 
        <td class=""><?php echo(get_field('result'));?></td> 
        <td class=""><?php echo(get_field('score'));?></td> 
       </tr> 
      <?php endwhile;?> 
      <?php endif;?> 
    </tbody> 
</table> 

答えて

0

は、単にテンプレートファイルを再度アップロードし、正しくソートするために始めています。

関連する問題