Created
February 15, 2020 00:39
-
-
Save betweenbrain/40142f047a0ab4968de50ddf53f6e5d7 to your computer and use it in GitHub Desktop.
WordPress load template part based on request (pseudo code)
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
global $wp; | |
$current_url = add_query_arg( array(), $wp->request ); | |
// echo '<pre>' . print_r($wp->request, true) . '</pre>'; | |
// Add logic here: | |
$load = locate_template( 'archive-activity.php', true ); | |
if ( $load ) { | |
// just exit if template was found and loaded | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment