Single template
The next template we need to create is the single post view. To view a single post, you can usually just click on the post title. Right now, the single post looks like the site's front page (because it's using index.php) - except with just one post.
To get started, again make a copy of index.php, and name the copy single.php. This is the template that WordPress will look for first when it's serving a single post. If it doesn't find single.php, it'll use index.php.
Without further delay, here's my single.php file. You should notice that the file features almost exactly the same elements as the index.php. The only difference is that the get_template_part() function call fetches a different element. In this case, it's single. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access