Hi everyone,
I’m trying to show the current template file or what template file is being used.
I tried this one:
add_action('wp_body_open', function () {
global $template;
if( current_user_can('administrator') ) {
echo '<!-- Template File: ' . basename($template) . ' -->';
}
});
But it always shows index.php
I also tried other plugins that will show the current template file but sadly it always returns to index.php
Does anyone know how to solve this issue?
Thank you