From 4.3 we have a new template, singular.php. I tried to understand what is it, but I didn’t get it. 🙂

The page.php for pages.
The single.php for every post types. If we have single-[post-type].php we can use a specific template for the custom post type.. so why we need singular.php?

3

It’s the nature of the WordPress template hierarchy – point being, if you don’t have a page.php, it will use singular.php, same if you don’t have single.php, it will fallback to a template lower in the hierarchy.

Ideal for themes that have the same layout for posts/pages, instead of having duplicate code in each respective template.

Leave a Reply

Your email address will not be published. Required fields are marked *