【发布时间】:2016-06-16 04:14:45
【问题描述】:
我想使用函数 get_template_part() 将我所有的自定义页面加载到首页;但是每当我保存我的代码时,页面都会在首页加载所有内容,但会不断地在网站上一遍又一遍地循环内容。
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/header'); ?>
<?php get_template_part('templates/page-about'); ?>
<?php get_template_part('templates/page-services'); ?>
<?php get_template_part('templates/page-portfolio'); ?>
<?php get_template_part('templates/page-contact'); ?>
<?php get_template_part('templates/footer'); ?>
<?php endwhile; ?>
</main><!-- #main -->
</div><!-- #primary -->
我也要上传到githubhttps://github.com/brandonpowell/Test-Wordpress-Site/tree/master/danielschriersite
【问题讨论】: