Php Wordpress循环浏览父页面并显示未按预期工作的内容()

Php Wordpress循环浏览父页面并显示未按预期工作的内容(),php,wordpress,custom-wordpress-pages,Php,Wordpress,Custom Wordpress Pages,我正在尝试循环浏览父页面并显示标题、内容和永久链接。一切都按预期进行,只是_content()没有显示任何内容。我把它放在一个自定义页面模板中,这样我就可以在整个网站的其他页面上使用它。你知道我做错了什么吗 $pageID = $wp_query->post->ID; $child_pages = new WP_Query( array( 'post_type' => 'page', 'posts_per_page' => 4, 'po

我正在尝试循环浏览父页面并显示标题、内容和永久链接。一切都按预期进行,只是_content()没有显示任何内容。我把它放在一个自定义页面模板中,这样我就可以在整个网站的其他页面上使用它。你知道我做错了什么吗

$pageID = $wp_query->post->ID;

$child_pages = new WP_Query( array(
    'post_type'      => 'page',
    'posts_per_page' => 4,
    'post_parent'    => $pageID,
    'no_found_rows'  => true
    ) );

while ( $child_pages->have_posts() ) : $child_pages->the_post();

the_title();
the_content(); // Also tried apply_filters, didn't work :(
echo '<br>';
get_the_post_thumbnail();

endwhile;

wp_reset_postdata();
$pageID=$wp\u query->post->ID;
$child\u pages=新的WP\u查询(数组(
“post_type”=>“page”,
“每页帖子数”=>4,
“post_parent”=>$pageID,
“未找到任何行”=>true
) );
而($child_pages->have_posts()):$child_pages->the_post();
_title();
_content();//还尝试应用\u筛选器,但不起作用:(
回声“
”; 获取帖子缩略图(); 结束时; wp_reset_postdata();
请使用get_the_content(get_the_ID())来代替_content()。我希望这会对您有所帮助。谢谢兄弟,我会试一试,看看会发生什么。@SajidAnwar不起作用,它仍然只显示标题,下面没有内容。请使用get_the_the_content(get_the_ID())来代替_content().我希望这能对你有所帮助。谢谢兄弟,我会试一试,看看会发生什么。@SajidAnwar不起作用,它仍然只显示标题,下面没有内容。