I recently downloaded the new Starkers v4 theme. I noticed that in lieu of using
<?php get_header(); ?>to include the header code
<?php get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?>and by which including 2 separate files /parts/shared/header.php and /parts/shared/header-html.php
I am just curious if there is any benefit to doing it this way? I would normally just create a header.php file and put in the root theme folder and call it using:
<?php get_header(); ?>
Can someone give me a reason(s) to take this approach. It sort looks like they were trying to take more of a MVC approach to the theme code.
- The topic ‘Benefit of get_template_parts’ is closed to new replies.