Created
May 17, 2012 16:33
-
-
Save zanematthew/2720021 to your computer and use it in GitHub Desktop.
Hook into template redirect before it can redirect
This file contains hidden or 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_action('template_redirect', function() { | |
$tmp = explode( '/', $_SERVER['REQUEST_URI'] ); | |
$my_slug = 'feeds'; | |
if ( isset( $tmp ) && $tmp[1] == $my_slug ) { | |
load_template( '/path/to/my/template/' ); | |
// or do what ever you want | |
exit(); | |
} | |
}, 6); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment