【发布时间】:2020-06-22 09:28:30
【问题描述】:
我有一种自定义帖子类型,并且我使用 acf 创建了一个选择字段。我需要删除到循环中,选项的结果相同。
<?php
$args = array(
'post_type' => 'agentiestero',
'post_status' => 'publish',
'posts_per_page' => 150,
'orderby'=> 'title',
'order' => 'ASC'
);
$the_query = new WP_Query( $args );
?>
<?php if( $the_query->have_posts() ): ?>
<?php while( $the_query->have_posts() ) : $the_query->the_post(); ?>
<option value="<?php the_field('localita_estero'); ?>"><?php the_field('localita_estero'); ?></option>
<?php endwhile; ?>
<?php endif; ?>
【问题讨论】:
标签: javascript php wordpress advanced-custom-fields