php - Empty content after WP_Query() -
i have plugin calls specific page. below code works fine , calls page inside modal, reason rest of page doesn't execute after using code , returns empty:
$args = array( 'p' => 33, // id of page, post, or custom type 'post_type' => 'any' ); $my_query = new wp_query($args); while ($my_query->have_posts()) : $my_query->the_post(); ?> <div class="entry"> <?php the_content(); ?> </div> <?php wp_reset_postdata(); endwhile;
any idea what's going on?
thanks,
try wp_reset_query(); instead of wp_reset_postdata(); after endwhile; may can work you.
Comments
Post a Comment