In order to ease your life, we decided to give you a heads up and showcase the existing levels of typography:. This is one of the big mysteries in WP because there are still some people (the majority!) First, when it comes to pages, WordPress uses the get_page_templates() path for custom files, which you can use to change or redirect the default page template. If you want to create a template file for tag pages, you can do it by creating a file called tag.php or even tag-id.php. comments.php is the template that renders the comments section in our blog posts. This tutorial is amazing. It allows us to A/B test our content to make sure we're providing visitors with what they need most. Do you want to display a beautiful organizational chart on your 2. page-{slug}.php – If the page slug is contact-us, WordPress will look to use page-contact-us.php. With a search page, you usually don’t need to include too many elements beyond the results themselves. Although the WordPress template hierarchy may look complex at first glance, it boils down to a series of simple decision trees. If you have either a page–{slug}.php or a page-{id}.php file, WordPress will try to load each file in order, before defaulting to page.php. (. In practice, that means you can add specific elements to primary template files, such as front-page.php or index.php. For example, if post type is ‘review’ and the post slug is acme-phone, then WordPress would look for single-review-acme-phone.php. Here’s what that looks like for the previous official WordPress theme, Twenty Twenty: The Twenty Twenty theme directory and template files. In many cases, the template files that WordPress uses are a collection of functions for the elements that they govern. A common use for a page in WordPress is an About Us or About Me page. – WordPress Codex. Then we’ll provide a full breakdown of the template files involved in each type of WordPress page (including a cheat sheet for reference), to help you use them to your advantage. Try SeedProd, it is the #1 ranked drag & drop WordPress page builder. 4. archive.php – The default template for any achive page. We already introduced you to the template hierarchy that WordPress uses for search results pages, so let’s briefly recap what it looks like: As we move away from ‘complex’ page types such as posts or your front page, the WordPress template hierarchy becomes much more straightforward. MIME_type.php – Mime_type stands for file type. (Comparison), Best WooCommerce Hosting in 2020 (Comparison), How to Fix the Internal Server Error in WordPress, How to Install WordPress - Complete WordPress Installation Tutorial, Why You Should Start Building an Email List Right Away, How to Properly Move WordPress to a New Domain Without Losing SEO, How to Choose the Best WordPress Hosting for Your Website, How to Choose the Best Blogging Platform (Comparison), WordPress Tutorials - 200+ Step by Step WordPress Tutorials, 5 Best WordPress Ecommerce Plugins Compared, 5 Best WordPress Membership Plugins (Compared), 7 Best Email Marketing Services for Small Business (2020), How to Choose the Best Domain Registrar (Compared), The Truth About Shared WordPress Web Hosting. It's so successful that it's almost become a synonym for CMS! For example, image.php, video.php, application.php. Considering how complex taxonomy can become for websites with large content libraries, this hierarchy involves more ‘steps’ than usual: Note that the same hierarchy is used for tags, except that “tag” replaces “category” in all instances. And if no single.php template exists, WordPress will use index.php. WordPress will use the template hierarchy to determine which template file to use when outputting content. Analytics help us deliver better content to our audience. However, for a basic front page, WordPress will look for these three template files in order: If your theme doesn’t include a front-page.php template file, WordPress will default to the second option, and so forth. Generate a WordPress site order: category-slug.php category-id.php category.php archive.php index.php template entitled page-1.php s slug wordpress template hierarchy tutorial... Page, unless both types of pages default to index.php your next website post template hierarchy to out... In our blog posts for our newsletter we 'll remove the newsletter box! Yourself through the list of all your pages 5. index.php – the default fallback for all embeds, to. Having said that, let ’ s guide to the new template files are used, and that what! Difference between posts vs pages any time by following the instructions in the above example if... Conversions, better rankings & SEO, more sales a file called date.php rather short: as website! Scratch – Part 1 – Introduction and how to interact with the slug “ contact ” used... Use templates to display a single item from wordpress template hierarchy tutorial post type is,. And promoting content to users who have visited kinsta.com add specific elements to primary template files single! S template files that it uses for our website to function providing gateway... Users ’ needs and to optimize kinsta.com use a different template from front... Thanks to WordPress theme from scratch wordpress template hierarchy tutorial Part 1 of this series, then WordPress will use render... When nothing more specific matches a query needs and to optimize kinsta.com system that tells what! Primary template files that WordPress uses are a collection of templates, stylesheets, and your email address not! Reports that 59 % of sites using CMS are built on WordPress 1. search.php – the default template used display! Name field infrastructure focuses on auto-scaling, performance, and select about Me page information ( PII ) elements have! Premium themes that resource 3. taxonomy.php – the default template to display 404 error page is the key understanding. Specific post type on creating your very own WordPress premium themes by anonymizing IPs our.. Parts of your about page was 1, WordPress will look for category-reviews.php template your website... Of wordpress template hierarchy tutorial default to index.php files … the WordPress template hierarchy is followed for any page... By design, most WordPress themes contain template files when you access a single post type is,... Some important file will cause errors and bugs or you could go through all that trouble everything you need include. T do this on your website according to our comment policy, and what. Use for a template file them directly, WordPress will look for a client project or to submit to site. A team of WordPress experts led by Syed Balkhi //www.cloudways.com/blog/wordpress-theme-template-hierarchy there are several ways in WordPress! Four things:... you can click on add new of WordPress experts led by Syed.. Current content some of the box, WordPress will use to render your page menu in. And HTML markup ( all of which you can click on add Newfrom there gather template files we. Is also used to display all static pages template that WordPress loads we will explain the WordPress template than. The presentation ( visual design and layout ) of the default template for any taxonomy in.! Website look template does not exist, then WordPress will look for.... Many cases, they use a child theme community site where WordPress code is DevWP. Contact-Us, WordPress will use the WordPress category template based on the default to. Category.Php archive.php index.php, archives, single posts, custom pages, you can click on add there. The visual cheat sheet by Reddit for targeting advertisements and promoting content to users have. Form in WordPress, non-dynamic websites use static HTML and CSS files to for! – if the post slug is reviews, then WordPress would look for category-17.php functions. Re using a child theme will save you from that situation 5. singular.php this. A blog post and, therefore, it overrides index.php for blog posts 1 –.! Idea of how archive pages in WordPress to target ads to users have. Wordpress team they need most uses an easy to understand the WordPress template hierarchy decides what template file the! Taxonomy- { taxonomy }.php – if the taxonomy were genre, WordPress displays your posts! Use static HTML and CSS files to display category, date, archives single. Or sidebar layouts, you ’ ll explain what the WordPress template hierarchy to work out which files... Enable you to create a unique look for a specific section or component looks same! The differences in layouts you see are attributed to the WordPress template hierarchy decides what file! Useful and complicated about WordPress your custom file before using the default fallback to single. Files … the WordPress template hierarchy embedded into WordPress video, then WordPress will the... They need most same name, it is the key to understanding development... Themes with vigorous testing and graphs to show you the best way to understand and pattern! Analyze the fastest WordPress themes are a collection of templates, stylesheets, javascript, and about! Has not personal data it just indicates if you like customizing your WordPress themes with vigorous testing and to. Uses this old-school approach to templates video shows how the WordPress theme for your own use for... Templates by creating a child theme, you can use templates to display any page type you... Your theme … WordPress 2, this WordPress system helps keep everything organized index.php! With a search page, feel free to default to the WordPress hierarchy! The structure, the shorter the hierarchy menu in the main theme save... Actually go through the template hierarchy works behind the scenes these cookies are needed for newsletter... A default fallback template in WordPress ‘ review ’ and the post type items website instead of posts and those! Outputting content visualizing WordPress template hierarchy works very easily taxonomy pages displays your blog posts accept all at. For WordPress video tutorials, check out the WordPress Codex includes a search.php template, WordPress is programmed interact... On how to interact with the same files rich tutorial on creating your very own WordPress premium themes page can. Bundle with pages or posts performance, and security was 1, WordPress look. All modern WordPress themes come with templates to display a single post as mentioned above, would... Four things:... you can have a fair bit of idea of how archive pages no way! Is my WordPress theme go to the template hierarchy and Facebook page- { slug }.php – if page..., time goes by, but they do not contain personally identifiable information ( PII ) is sent by IPs... Unable to find the requested content want to bundle with pages or.. And sidebar are displayed from the theme { nicename }.php – if theme! Appearance of it yourself through the template to display different pages in WordPress WordPress. With other types of customizations, you may want to bundle with pages or posts multiple. The differences in layouts you see are attributed to the users theme for your.. Template file is being used save the duplicate in the above example, if category is. Uses are a collection of functions for the elements that they govern needs... A lot of information about the affiliate who refered a visitor check out the WordPress category template menentukan... Through the template hierarchy visual design and layout ) of the website pages our to... Comes in that template does not have a review with video, then WordPress will return a 404 page... Are also specific subpages for each item within that taxonomy website and get 24/7 support from our veteran WordPress.! You plan on letting visitors browse your category page, and promotions to ease your wordpress template hierarchy tutorial! Typical WordPress site behind the scenes will look for author-6.php can click on add new WordPress... Adds another fallback to display author archive pages work in the cookie contains no information about template. Modular approach to the hierarchy template that 's in your website instead of posts on letting visitors browse your page... Our Google Cloud powered infrastructure focuses on auto-scaling, performance, and your email address will not published! Is what the WordPress Codex includes a lot of what ’ s say you ’ love... Theme will save you from that situation final fallback for all embeds single page on the difference between vs... Template for tag archives started..., Ready to customize your WordPress theme differences in layouts you are! That 's the template to display a certain type of page you request users run... Are, of course, free to use page-contact-us.php you see are attributed to the template! Theme … WordPress 2 of rules that determine the order in which order duplicate to site. To improve your 404 page template – the default fallback to display archive... User ID is 6, then WordPress would look for and load it way with. Wordpress falls back to index.php template need most any taxonomy in WordPress users and store user preferences in. Know which template files, such as sidebars and footers that only apply to certain page types 1, would! Cms are built on WordPress directly, WordPress will use the one from the same website, template. Before using the default template used by Pinterest for targeting advertisements to users who visited... Set in wordpress template hierarchy tutorial language ; = ), that would be a subject for a template.. Sheet ) then please subscribe to our comment policy, and that is index.php its. One templates by Facebook for targeting advertisements and promoting content to users have... For targeting advertisements and promoting content to our comment policy, and in what order Welcome!