Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WordPress load template part based on request (pseudo code)
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment