0
我有一個調用特定頁面的插件。下面的代碼工作正常,並要求我的語氣裏面的頁面,但該頁面的一些其他原因使用此代碼後,不執行和返回空:WP_Query()後的空白內容
$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;
任何想法是怎麼回事?
謝謝,
把'wp_reset_postdata();'在'endwhile後面'' –
我做了,仍然是一樣的 –