Created
August 27, 2016 13:20
-
-
Save gareth-gillman/cf790acb2ee40220a4834a83fcde4338 to your computer and use it in GitHub Desktop.
WordPress Plugin Template Include
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
add_filter('template_include', 'my_function_name', PHP_INT_MAX, 2 ); | |
function my_function_name( $template ) { | |
if(is_page('about')){ | |
$template = dirname( __FILE__ ) . '/templates/about.php'; | |
} | |
return $template; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment