Skip to content

Instantly share code, notes, and snippets.

@tobeyadr
Created May 11, 2020 14:50
Show Gist options
  • Save tobeyadr/6627fc5acc5caf44bafa45f2e091a444 to your computer and use it in GitHub Desktop.
Save tobeyadr/6627fc5acc5caf44bafa45f2e091a444 to your computer and use it in GitHub Desktop.
<?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