Wordpress - 单独的博客页面没有显示帖子并显示自定义主题的主页...(没有重定向到主页只显示代替博客页面的链接 http://www.example.com/blog 在浏览器的地址栏上)
因为我已经调整了 wp-admin 的设置 的 SETTING>读> 静态页面 首页到主页(主题的主页)和 发布博客(主题的单独博客页面)
博客页面包含以下代码
<?php
/*
Template Name: Blog
*/
get_header();
if ( have_posts() ) :
// Start the Loop.
while ( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
endwhile;
// Previous/next post navigation.
next_previous_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part( 'content', 'none' );
endif;
get_footer(); ?>
主题的主页几乎是静态页面。
答案 0 :(得分:0)
确保您的静态主页模板不在名为index.php
或home.php
的文件中。如果WordPress检测到这些文件中的任何一个,它将自动认为它是您帖子的模板。因此,为您的静态主页创建front-page.php
或类似内容,为帖子页面创建index.php
或home.php
。