显示与主页相同内容的博客页面

时间:2013-08-12 作者:vytfla

我正在尝试将我的帖子发布到另一个页面(博客)上,我的“主页”显示为我的首页。这两个页面都有自己的模板(home for home,blog for blog)。

在阅读设置中,我将首页设置为主页,将帖子页面设置为博客。但当我转到url时。com/blog,它显示与我的主页相同的模板。我不知道为什么它不会显示我的两篇博文。

在我家。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-->

1 个回复
SO网友:vancoder

帖子页面将始终为索引。php或主页。php。也就是说,WordPress将始终使用其中一个文件来显示您的博客帖子。即使您在设置中设置了其他页面(如“博客”),WP也会忽略为该页面设置的所有内容,除了标题。请参见codex.

结束

相关推荐

Http_host在函数中更改。php

我从$_SERVER[\'HTTP_HOST\'] 中的变量functions.php 我们的子主题文件。我们正在NGINX上运行WordPress 3.5.2,页面线2.4是我们的父主题,我可以在必要时详细介绍一些插件。我们的虚拟主机已设置为响应:*.salesgenie.com 因为我们有几个私有标签子域,这将改变网站的品牌。www.salesgenie.com 将是通用域,但att.salesgenie.com 是品牌子域的一个示例。我需要能够检测到客户端调用的子域,我正试图使用该子域$_