Skip to content

Instantly share code, notes, and snippets.

@primedime
Created February 1, 2018 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save primedime/9e2498437a4b911794ed5fe7923c5461 to your computer and use it in GitHub Desktop.
Save primedime/9e2498437a4b911794ed5fe7923c5461 to your computer and use it in GitHub Desktop.
function my_template( $template ) {
$url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
// check if the page url contains ?id=
if( strpos($url,'?id=') !== false ){
if ( $new_template = locate_template( array( 'page-company-profile.php' ) ) )
return $new_template ;
}
return $template;
}
add_filter('template_include', 'my_template');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment