Wordpress 使用 index.php 而不是 single.php 来显示帖子 [英] Wordpress use index.php instead of single.php to show post
问题描述
我的 Wordpress 网站没有使用 single.php 来显示网站上的帖子.每次我打开一个帖子,它都会在 index.php 中打开.
My Wordpress websites are not using single.php to show posts on the website. Every time I open a post, it opens it in index.php.
我的 single.php 看起来像这样
My single.php looks like this
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<? echo the_content(); ?>
<? endwhile;
endif; ?>
<? get_footer();
?>
我该如何解决这个问题?
How can I fix this?
推荐答案
在单击 single-post-link 后,无论是 single-CUSTOM-TYPE.php 还是 single.php,我都遇到了同样的问题.... 只有 index.php 而不是正确的文件...
I had the same problem with neither the single-CUSTOM-TYPE.php nor the single.php being rendered after clicking the single-post-link.... only index.php instead of the correct file...
帮助我的是在设置"->永久链接"中简单地改回标准永久链接,并恢复到帖子名称"(Beitragsname)......
What helped me was a simple change back to Standard Permalinks in "Settings" -> "Permalinks" and a restore back to "Name of the Post" (Beitragsname)....
...也许这也可以帮助其他人...问候
...maybe this might help someone else as well... greetz
这篇关于Wordpress 使用 index.php 而不是 single.php 来显示帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!