Well, that tutorial is pretty old and out of date. It was written for WordPress 2.0; 10 major releases ago.
The short answer is: it’s done that way because it’s the best way to do it. It’s the fastest/simplest way to separate content from design and give all the control to you, the theme developer.
If you don’t want to open a tag in the header without closing it in the header, don’t. I personally always do that (although I usually close it in the footer, not the index.php file). The great thing about WordPress is that it lets you do whatever you want.
Here are two good reasons to use get_header()
:
- It fires an action hook that plugins may be using, and
- It makes your theme more compliant and therefore easier to use as a template for child themes.
Related Posts:
- Where can I learn to create my own theme?
- How to Link External jQuery/Javascript files with WordPress
- Adding Language Support using .pot and .mo files to a WordPress Theme?
- Any official way to create an admin theme?
- Changing the visible url path to css & js files
- WordPress theme with multiple color schemes
- How to start learning CSS and theme development?
- How do I make the category template display full posts instead of partial posts?
- JavaScript Files Registered in Parent Theme Won’t Load When Calling wp_enqueue_script() in Child Theme?
- Make theme settings support multisite enabled (WordPress Mu) site
- How to change background color in the Notepad++ text editor?
- How to change or add theme to Android Studio?
- Sizing screenshot.png without losing aspect ratio
- WordPress frameworks and parent themes [closed]
- Opinions and recommendations on the best barebones base theme [closed]
- Remove JSON API links in header html
- Using OOP in themes
- Where can I download WordPress themes from? [closed]
- How can I allow the Editor Role to change Theme Settings?
- How to add CSS class to custom logo?
- What are all the available parameters for query_posts?
- How to add custom css file in theme?
- Customizing a WordPress theme without changing it?
- How do I turn off self-closing tags for markup in WordPress (for HTML5, or HTML4, for example)?
- how to add version of style.css in wordpress
- Does WordPress work without a theme?
- What is the role and history of the $content_width global variable?
- theme path in javascript file
- Adding admin-ajax.php to the frontend. Good or bad idea?
- get_template_part vs action hooks in themes
- How to move the sidebar in TwentyFifteen to the right?
- Installation failed: Download failed. No working transports found
- What is theme-compat?
- Override parent theme translation on child theme
- The the_post_thumbnail without srcset?
- WordPress Theme activation hook?
- The proper way to include/require PHP files in WordPress
- after_setup_theme always runs
- Can wordpress theme folder name be changed freely and nothing technically happens
- Link to specific Customizer section
- What does exactly GPL license mean for my WordPress theme?
- Do I actually need to link my theme’s style.css in the theme files
- Am I allowed to license my WordPress theme under the aGPL
- Using classes instead of global functions in functions.php
- WordPress API Menu/Submenu Order
- How do I change the header image height in Twenty Seventeen?
- Starter Theme vs Parent Theme? Pros and cons
- How to insert a logo in the header?
- How to change the language for the front-end only?
- W3 Total Cache, CDN and theme files [closed]
- How to move page template files like page-{slug}.php to a sub-directory?
- Best way to include Bootstrap in WordPress
- How do register_sidebar() and get_sidebar() work together?
- CSS classes for theme
- How to set thumbnail image for a (child) theme
- Different template of products for specific category. WooCommerce
- Show different theme for admin?
- How can I version the main CSS file?
- Add custom classes to anchor in wp_nav_menu
- what the best way to include images from the template’s images folder?
- How to remove search bar from a wordpress theme? [closed]
- Display random categories on the front page (Finding and Editing Theme Functions)
- Is it OK to remove theme credits from footer? [duplicate]
- Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067
- Should `get_template_directory_uri()` be escaped?
- Get url of thumbnail from the media uploader
- My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”
- How can I get the title attribute from get_the_post_thumbnail()?
- Dash or underscore in theme folder name?
- No “Add New” Button. How to add new theme?
- How do I add support to my theme for custom menus?
- “Unexpected error” on update requests
- How to prevent plugin, theme installation failures on WordPress?
- How do I white label my self-hosted site created by wordpress?
- Do Child-Themes automatically load the Translation from the Parent-Theme?
- When cropping a header image, retain meta data (i.e. name, description, etc.) from original image?
- How To Add New Option Types To Option Tree?
- Best practices for a Style/CSS based theme options page?
- WP 3.4 – what action/hook is called when theme customisation is saved?
- What WP folder can I use to write files to?
- How to create a new theme from scratch?
- Categorising themes by folders in backend
- Switching themes without losing widgets?
- Are the WordPress Core CSS styles really all nessesary?
- How to use media upload on theme option page?
- Add a dropdown to theme customizer
- Should I use set_transient or update_option?
- Why doesn’t default WordPress page view use force_balance_tags?
- Dynamic template serving, change theme_root using add_filter from current theme
- What theme is good for posting code? [closed]
- WordPress 5 / Gutenberg – theme doesn’t have featured image option showing up
- Page template in two level deep folder
- Custom Taxonomy-specific JavaScript
- How to refresh WordPress Customizer panel upon entering a value
- Set Featured Image for Archive templates
- is_front_page only works in theme file, and does not work in functions.php
- What is meant by __(‘page’,’twentytwelve’)
- How do I add a new string to a .po or .pot file?
- Difference between stylesheet_directory and template_directory
- Free/Open-Source Theme Frameworks as an Alternate to Thesis? [closed]