【发布时间】:2019-02-25 13:14:59
【问题描述】:
我正在从头开始设计一个主题。这是一个单页网站,我的 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 中的部分?
谢谢
【问题讨论】:
-
你是指哪些类?身体课?这在很大程度上取决于您的 CSS 的组织方式。
-
我的页面中的类-xxx.php。