我正在尝试将我的文章放在另一个页面(博客)上,我的主页显示为我的头版。这两个页面都有自己的模板分配给他们(家为家,博客为博客)。
在阅读设置中,我将首页设置为主页,文章页面设置为博客。但是当我访问url.com/blog时,它会显示与我的主页相同的模板。我不知道它为什么不显示我的两篇博文。
在我的home.php模板中,我有以下代码,这可能是问题所在吗?
<!-- Display featured images -->
<?php
$args = array('post_type'=> 'page');
query_posts( $args );
?>
<!-- Get featured images -->
<div class="main-thumb left">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
?>
<li>
<a href="<?php echo get_permalink(); ?>">
<div class="tint">
<div class="overlay caps">
<?php
echo(types_render_field("top-overlay", array("output"=>"html")));
?>
<?php
echo(types_render_field("bottom-overlay", array("output"=>"html")));
?>
</div> <!-- end .OVERLAY-->
<?php the_post_thumbnail(); ?>
</div> <!-- end .TINT-->
</a>
</li>
<?php
}
}
?>
</div> <!-- end .MAIN-THUMB-->发布于 2013-08-12 21:31:05
无论根据模板层次结构是什么,home.php都将用作主页:
https://stackoverflow.com/questions/18196663
复制相似问题