Created
November 3, 2016 13:33
-
-
Save djrmom/159eeff45afe8405d9e5db77d36454a7 to your computer and use it in GitHub Desktop.
WordPress front page template hierarchy modifications
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 | |
/** | |
* Filters frontpage_template to allow both front-page.php as default static front page template while allowing | |
* users to select a different template in page options, also removes front-page.php from being used for the blog index | |
* From discussion in https://themehybrid.slack.com/archives/general/p1474838117000393 | |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
*/ | |
function prefix_front_page_template( $template ) { | |
return ( is_home() || locate_template( get_page_template_slug() ) ) ? '' : $template; | |
} | |
add_filter( 'frontpage_template', 'prefix_front_page_template' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment