Created
May 11, 2020 14:50
-
-
Save tobeyadr/6627fc5acc5caf44bafa45f2e091a444 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 | |
// Load after Groundhogg | |
use function Groundhogg\is_managed_page; | |
add_filter( 'template_include', 'load_custom_preferences_page', 11 ); | |
/** | |
* Load the custom template from the them folder | |
* | |
* @param $template | |
* | |
* @return string | |
*/ | |
function load_custom_preferences_page( $template ){ | |
if ( ! is_managed_page() ) { | |
return $template; | |
} | |
$page = get_query_var( 'subpage' ); | |
if ( $page !== 'preferences' ) { | |
return $template; | |
} | |
// Path to your custom preferences page... | |
return get_theme_file_path( 'preferences.php' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment