Benefit of get_template_parts
-
I recently downloaded the new Starkers v4 theme. I noticed that in lieu of using
<?php get_header(); ?>
to include the header codeThey’re using
<?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.phpI 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.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Benefit of get_template_parts’ is closed to new replies.