My page templates are currently built up as shown in first example but I really don't like that half of the template is just sitting there, not being used and takes the server resources for no good reason.
Does everything in both examples gets parsed by server, emphasis
on get_template_part()
?
<?php
//Page template
if( $something ) {
// 1000 lines of code
}
else if( $something_else ) {
// 1000 lines of code
}
?>
versus
<?php
// Page template
if( $something ) {
// Template with 1000 lines of code
get_template_part( 'lib/template', 'option-a' );
}
else if( $something_else ) {
// Template with 1000 lines of code
get_template_part( 'lib/template', 'option-b' );
}
?>