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
- Override parent theme translation on child theme
- The the_post_thumbnail without srcset?
- after_setup_theme always runs
- Why I can’t add a CSS style in this WordPress theme?
- How to incorporate admin theme in my back-end-plugin
- reason of splitting theme files to multiple files
- Using chunk theme from wordpress.com on my own host
- What is the first file wordpress looks at in a theme?
- Duplicate and change a Theme Widget
- Two Navigation Menus in Themes Produce the same menus?
- Theme not showing after uploading
- new theme permissions don’t allow me to edit
- Being asked to update a theme that I don’t have
- I want to run different WordPress websites under the same database
- How to get custom image size for image uploaded in Customizer
- get_template_directory_uri does not seem to work when defining WP_CONTENT_DIR
- How can a Theme Contain no Header File or Footer File?
- Using a _GET gives me a debug error (over my head)
- Some translations do not work in my template class
- Possible to put header-{your_custom_template}.php in subdirectory?
- Why wp_enqueue_style() not working?
- 404 Error while accessing the font files
- Set WordPress Default Template
- Load a different theme for IE less than 9
- How to get current post user id
- Theme Check reporting an incorrect theme slug and text domain
- The problem with WordPress Importer
- WordPress themes that are browser tested and maintained?
- Remove transparancy in Sydney theme’s headerimage
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- Is there any WordPress theme for Self Storagae just like Spacer [closed]
- Customizer: save setting/control content to post/page
- stylesheet is not readable error after installation
- Highlight static blog page link in header
- Customizing page content layout
- Widget Option is Missing
- Putting two themes together to create a complete site
- How does WP generate html?
- If you were to start using a WordPress framework today, which one would you use? [closed]
- How to dynamically change theme’s slogan from admin?
- Using WordPress Multisite to manage multiple projects?
- What’s a good way to unenqueue all scripts for a single template page?
- Is it possible to have a theme that uses only one single page?
- Icons not showing [closed]
- How to write “alt” tag in image for wordpress code?
- Error 404 for JQuery import “jquery-1.10.2.min.map”
- Passing dynamic options from backend to frontend
- Adding a gallery to my first theme
- WP HTML Templates – Any way to get bloginfo() or the path to the theme folder?
- Theme javascript/css 404
- Changing URL of scripts, scripts outside theme folder?
- Valid SQL query not returning results
- How to use only scripts from new theme?
- How can I assign separate stylesheets to different pages?
- Conditional config WP_HOME/WP_SITEURL does not update bloginfo(‘template_url’)?
- Recommended sidebar / content widths
- Two column layout in WordPress?
- Converting a theme to a child theme in a network
- WordPress Theme Breaking on Migration to Live Site [closed]
- WordPress doesn’t recognise created theme
- Looking for a theme to show unread/updated posts since last visit or like that
- Why does an ad page open when I browse my websites’s wp-admin page?
- Get the name WordPress default theme in the core
- What is the correct way to set up a staging server and use github for version control?
- How do I use the default style for widget?
- WordPress fails to embed video URL on specific theme
- Calling a WP Plugin Function’s Variable in Theme Template [duplicate]
- How to make updatable custom WordPress theme?
- How can I access variables from theme in child theme? [closed]
- Unable to set social icons using Advance Portfolio Theme
- How to add extra custom social icons to page with same style?
- Local variable name in setup_postdata()
- Child theme menu not appearing in Twenty Seventeen
- how make wp include urls as https?
- how to costume title single page
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- Where can I find a theme that has a big banner
- Site broken after deleting inactive themes [closed]
- Featured images are cropped on index and post page
- How to migrate the menu from the site on my own theme in WordPress?
- Change theme’s thumbnail to cropped WP featured image
- php file child theme directory not overriding parent theme php file [duplicate]
- Stylesheet not being loaded? [closed]
- is it possible to create a website with wordpress with these requirements without coading?
- Where can I decide the number of posts to display on the blog index page?
- I need to disable responsive feature of a theme called Meet GavernWP [closed]
- how to add dynamic footer credit in Greatmag theme [closed]
- Twenty Fifteen Premium Theme [closed]
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- Table of Contents in Left Navbar [closed]