すべてのカスタム テンプレートを含む front-page.php を持つ単一ページの Web サイトがあります (それぞれが静的ページです)。
<?php get_header();
$args = array(
'sort_order' => 'ASC',
'sort_column' => 'menu_order',
'post_type' => 'page',
'post_status' => 'publish'
);
$pages = get_pages($args);
foreach ($pages as $page_data) {
$content = apply_filters('the_content', $page_data->post_content);
?>
<?php echo "$content" ?>
<?php
}
get_footer();
?>
「the_content」を使用すると、バックエンドのテキストのコンテンツのみが参照されますが、テンプレート自体の the_content タグを囲むすべてのタグは参照されません。次に例を示します。
<?
/*
Template Name: Features
*/
the_post()
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<section>
<? the_content() ?>
</section>
<?php endif; ?>
この場合、周囲のタグセクションは選択されておらず、マークアップに表示されません。
テンプレートだけでなくテンプレート全体を選択するには、front-page.php で何を変更する必要がありますか?
よろしくお願いします!