Single Post Page hierarchy

In the preceding section, we discussed pages as static elements. On the other hand, posts are highly dynamic and provide time critical information. Usually, the post list page changes frequently, with the new posts being displayed at the top of the list. In this path, we are considering the display of the complete details for individual posts or custom post types.

By default, WordPress posts are handled by either single.php, singular.php, or index.php, depending on the availability of the preceding template files in the hierarchy. Most themes contain a separate single.php file for handling posts and hence singular.php and index.php may not be used. The single.php template is quite similar to page.php. However, posts ...

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.