Answers for "display page template using functions.php"

PHP
0

display page template using functions.php

function define_current_theme_file( $template ) {
    $GLOBALS['current_theme_template'] = basename($template);

    return $template;
}
add_action('template_include', 'define_current_theme_file', 1000);

# Echo result in header.php
echo $GLOBALS['current_theme_template'];
Posted by: Guest on February-02-2021

Browse Popular Code Answers by Language