ギャラリーセクションのページテンプレートを作成する必要があります。
<?php
/**
* Template Name: Gallery
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages and that
* other "pages" on your WordPress site will use a different template.
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
get_header();
?>
// You can write your gallery content here
<section class="section single-page">
<div class="fixed_container">
<?php
// Start the loop.
while (have_posts()) : the_post();
// Include the page content template.
get_template_part('template-parts/content', 'page');
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
// End of the loop.
endwhile;
?>
</div>
</section>
<?php get_footer(); ?>
その後、管理者からギャラリーページを編集し、このテンプレートをギャラリーページに割り当てます。
ありがとうございます:)その作業!ヘッダーはフッターと内容が重なっています...を追加するか、別の解決策がありますか? –
これは、私が使用しているダミーのクラス(section single-page、fixed_container)です。 あなたはこのクラスをあなたと置き換えることができます。 "Page.php"を開き、同じクラス構造に従ってください。 – Dinesh