如何在wordpress主题中创建单个帖子页面?

use*_*743 3 wordpress themes

我是wordpress主题的新手.我通过创建index.php和style.css创建了一个wordpress主题.这个主题实际上是一个博客主题.所以,我已经设计了index.php中的所有部分,这是我的首页,我已经编写了php代码来自动显示wordpress的博客文章.它工作正常.

我的问题是,当我点击博客文章的标题时,它转到下一页,表明mysitenamedomain/post-id,我在该页面上似乎什么都没有.我是否想创建一个single.php页面来显示该页面上的标题,内容等?

Mar*_*cos 8

在single.php中你必须使用 loop

这是文档:Codex 尝试:(in single.php):

<?php while ( have_posts() ) : the_post(); ?>
<h3><?php the_category('&nbsp;&rsaquo;&nbsp;'); echo "&nbsp;&rsaquo;&nbsp;"; the_title(); ?></h3>
<?php the_content(); ?>
<?php endwhile; // end of the loop. ?>
Run Code Online (Sandbox Code Playgroud)

当然你必须设计风格.