据我所知,您想设置$id
随机从adzones
post类型post ID。我希望这对你有帮助-
$args = array(
\'orderby\' => \'rand\',
\'posts_per_page\' => \'1\',
\'post_type\' => \'adzones\'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$id = get_the_ID();
echo do_shortcode("[pro_ad_display_adzone id=".$id."]");
endwhile;