我构建了一个单页主题,并使用get_pages()
加载所有页面的步骤front-pages.php
, 但我无法加载带有自定义帖子类型的页面。这是我的密码front-pages.php
:
$pages = get_pages( array(
\'sort_order\' => \'ASC\',
\'sort_column\' => \'menu_order\'
) );
foreach ( $pages as $page_data ) {
$content = apply_filters( \'the_content\', $page_data->post_content );
$title = $page_data->post_title;
echo " <article class=\'hs-content\' id=\'section".$page_data->menu_order."\'>";
echo "<span class=\'sec-icon fa fa-home\'></span>";
echo "<div class=\'hs-inner\'>";
echo "<span class=\'before-title\'>.0".$page_data->menu_order."</span>";
echo "<h2>$title</h2>";
echo $content;
echo "</div>";
echo "</article>";
}