PHP 32
Show loaded template file By micha on 9th July 2023 11:26:19 AM
  1. <?php
  2. function show_which_template_is_loaded() {
  3.         if ( is_super_admin() ) {
  4.                 echo '<div class="debug" style="width: 60%; margin: 0 auto; text-align: center">';
  5.                 global $template;
  6.                 //print_r( $template );
  7.                 echo '<h4>Template: <code>' . basename( $template ) . '</code></h4>';
  8.                 echo '</div>';
  9.         }
  10. }
  11. add_action( 'wp_footer', 'show_which_template_is_loaded' );
  12. ?>

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.