感谢Dejo对此的正确回答。我只是想用上面提到的get\\u posts方法来发布这个结果:
<?php
$args = array( \'posts_per_page\' => 1, \'offset\'=> 0, \'category\' => 24 );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<?php the_field(\'alert\'); ?>
<?php endforeach;
wp_reset_postdata();
?>