0

私は子テーマで作業しており、ワードプレスの公開日ではなく、カスタム フィールドの日付でカテゴリの投稿を並べ替える必要があります。誰かが私を正しい方向に向けることができますか?

これは私のcontent-single.phpファイルにあるものです:

        <h1 class="info"><?php the_field('start_date'); ?> - <?php the_field('end_date'); ?></h1>
        <h1 class="info"><?php the_field('time'); ?></h1>
        <h1 class="info"><?php the_field('venue'); ?></h1>
        <a href="<?php the_field('tickets_link'); ?>"><h1 class="buytix">BUY TICKETS<?php the_field('buy_tickets'); ?></h1></a>

        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'vantage' ) ); ?>
        <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'vantage' ), 'after' => '</div>' ) ); ?>
    </div><!-- .entry-content -->

私はphpとワードプレスに非常に慣れていません。私は子テーマで作業しています。カスタムフィールドの日付で投稿を並べ替えるには、どのコードを追加する必要がありますか?また、正確にはどこに配置する必要がありますか?

4

1 に答える 1

0

WP_query() で指定するだけです:

例を参照してください: http://codex.wordpress.org/Function_Reference/WP_Query#Order_.26_Orderby_Parameters

于 2014-06-10T03:36:33.770 に答える