In Chapter 3 of this minibook, I introduce the concept of template files and give you an overview of the template files available to you. In Chapter 5, we explain the idea of overriding template files with child themes. The following sections explore some advanced uses of template files.
Although you rarely need to use all these techniques, being fluent in your options gives you flexibility to address specific needs quickly when they come up.
WordPress recognizes three special areas of a theme: header, footer, and sidebar. The get_header, get_footer, and get_sidebar functions default to loading header.php, footer.php, and sidebar.php, respectively. Each of these functions also supports a name argument to allow you to load an alternate version of the file. For example, running get_header(‘main’) causes WordPress to load header-main.php.
You might wonder why you would use a name argument when you could just create a template file named whatever you like and load it directly. The reasons for using the get_header, get_footer, or get_sidebar functions with a name argument are
In short, use the name argument feature if you have multiple, specialized header, footer, ...