-
-
Save spencerfinnell/46646f6a98dd9e01ab365734fc895024 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'page_template_hierarchy', | |
function( $templates ) { | |
$add = []; | |
if ( is_cart() ) { | |
$add[] = 'resources/views/layout/cart.php'; | |
} | |
if ( is_checkout() ) { | |
$add[] = 'resources/views/layout/checkout.php'; | |
} | |
// Prepend any found templates. | |
if ( ! empty( $add ) ) { | |
$templates = array_merge( $add, $templates ); | |
} | |
return $templates; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment