Created
May 20, 2021 08:02
-
-
Save andrii-kvlnko/25fba125483385f584591c1f9b119182 to your computer and use it in GitHub Desktop.
WordPress | Detect Page template name
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
add_action('wp_head', 'show_template'); | |
function show_template() { | |
global $template; | |
if ( isset( $_GET['test-template-name'] ) ) { | |
echo basename($template); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment