我正在从头开始设计一个主题。这是一个单页网站,我的 CMS 是 WordPress。我的文件夹结构是:
- 头版.php
- page-about.php
- page-work.php
- page-contact.php
我可以在 front-page.php 上将所有页面显示为部分,但我丢失了所有自定义类(和特定样式)。这是我的 front-page.php 中的循环:
<?php get_header(); ?>
<?php query_posts('post_type=page&order=ASC'); ?>
<?php
if (have_posts()):
while (have_posts()) : the_post(); ?>
<section id="page-<?php the_ID(); ?>">
<div class="container">
<h2><?php the_title(); ?></h2>
<article>
<p><?php the_content(); ?></p>
</article>
</div>
</section>
<?php endwhile;
endif; ?>
<?php get_footer(); ?>
如何将 page-xxx.php 的样式(因此,它们的类/ID)保留为我的 front-page.php 部分?
谢谢