Php WP_Query()后的内容为空

Php WP_Query()后的内容为空,php,wordpress,Php,Wordpress,我有一个插件,可以调用特定的页面。下面的代码工作正常,并在my modal内调用页面,但由于某些原因,页面的其余部分在使用此代码后不会执行,并返回空: $args = array( 'p' => 33, // ID of a page, post, or custom type 'post_type' => 'any' ); $my_query = new WP_Quer

我有一个插件,可以调用特定的页面。下面的代码工作正常,并在my modal内调用页面,但由于某些原因,页面的其余部分在使用此代码后不会执行,并返回空:

        $args = array(
          'p'         => 33, // ID of a 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; 
$args=array(
'p'=>33,//页面、帖子或自定义类型的ID
“post_类型”=>“任何”
);
$my\u query=新的WP\u查询($args);
while($my_query->have_posts()):$my_query->the_post();?>
尝试wp_reset_query();而不是wp_reset_postdata();结束后;

这可能对您有用。

Put
wp\u reset\u postdata()
结束时我做了,还是一样