how to get random post id by using post type
As far I understood you want to set the value of $id randomly from adzones post type post ids. I hope this helps you- $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.”]”); … Read more