Title: Current Page Template Viewer
Author: Nagaoka Design
Published: <strong>2025 年 8 月 1 日</strong>
Last modified: 2025 年 8 月 15 日

---

搜索插件

![](https://ps.w.org/current-page-template-viewer/assets/icon-256x256.png?rev=3337808)

# Current Page Template Viewer

 作者：[Nagaoka Design](https://profiles.wordpress.org/nagaokadesign/)

[下载](https://downloads.wordpress.org/plugin/current-page-template-viewer.1.1.0.zip)

 * [详情](https://cn.wordpress.org/plugins/current-page-template-viewer/#description)
 * [评价](https://cn.wordpress.org/plugins/current-page-template-viewer/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/current-page-template-viewer/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/current-page-template-viewer/#developers)

 [支持](https://wordpress.org/support/plugin/current-page-template-viewer/)

## 描述

This plugin helps WordPress developers by showing which template files are being
used on the current page. It displays the current template file name and directory
path in a convenient overlay, making it easy to identify which template is rendering
the current page during development.

The plugin shows a small, unobtrusive display that can be clicked to reveal detailed
information about all template files loaded for the current page.

**Key Features:**
 * Shows current template file name * Displays template directory
path * Click to view all included template files * Configurable display position(
top-left, top-right, bottom-left, bottom-right) * Customizable background and text
colors * Admin-only display option for security * Debug mode option (only shows 
when WP_DEBUG is enabled) * Lightweight and performance-optimized * Clean, modern
interface

**Perfect for:**
 * Theme developers * WordPress developers * Site debugging * Template
hierarchy understanding * Development and staging environments

The plugin is designed to be completely safe and non-intrusive, with options to 
restrict visibility to administrators only.

## 屏幕截图

[⌊Template display overlay showing current template information⌉⌊Template display
overlay showing current template information⌉[

Template display overlay showing current template information

[⌊Popup window displaying all included template files⌉⌊Popup window displaying all
included template files⌉[

Popup window displaying all included template files

[⌊Plugin settings page with all configuration options⌉⌊Plugin settings page with
all configuration options⌉[

Plugin settings page with all configuration options

## 安装

 1. Upload the plugin files to `/wp-content/plugins/current-page-template-viewer/`
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Go to Settings > Current Page Template Viewer to configure display options
 4. The template information will appear on the frontend according to your settings

## 常见问题

### How do I enable the template display?

After activating the plugin, it will automatically display template information.
You can configure the display options by going to Settings > Current Page Template
Viewer.

### How do I see all included template files?

Click on the template display overlay on the frontend. This will open a popup showing
all template files that were loaded for the current page.

### Can I change the display position?

Yes, you can choose from four positions: top-left, top-right, bottom-left, or bottom-
right through the plugin settings.

### Can I customize the colors?

Yes, you can customize both the background color and text color. The plugin supports
both hex colors (#ffffff) and rgba values (rgba(255,255,255,0.5)).

### Will this plugin slow down my website?

No, this plugin is designed to be lightweight and only displays information when
needed. It has minimal impact on performance.

### Can I restrict who sees the template information?

Yes, you can set the plugin to only show template information to administrators,
or you can set it to only display when WP_DEBUG is enabled.

### Is this plugin safe to use on production sites?

While the plugin is safe, it’s primarily intended for development and staging environments.
The admin-only and debug-only options make it safer for production use, but we recommend
disabling it on live sites.

### Does it work with child themes?

Yes, the plugin correctly identifies and displays both parent and child theme template
files.

### Can I hide the theme directory or template file name?

Yes, you can choose to display only the theme directory, only the template file 
name, or both through the plugin settings.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Current Page Template Viewer」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Nagaoka Design ](https://profiles.wordpress.org/nagaokadesign/)

[帮助将「Current Page Template Viewer」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/current-page-template-viewer)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/current-page-template-viewer/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/current-page-template-viewer/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/current-page-template-viewer/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/current-page-template-viewer/)。

## 更新日志

#### 1.1.0

 * **Major Fix**: Completely rewrote template detection system for WordPress.org
   compliance
 * Removed usage of global WordPress variables that were causing plugin review rejections
 * Implemented safe template detection using WordPress standard APIs only
 * Improved template file detection accuracy across all page types (posts, pages,
   archives, etc.)
 * Added proper fallback mechanisms for template detection
 * Enhanced compatibility with custom post types and taxonomies
 * Fixed template detection for complex WordPress template hierarchy
 * Removed PHP closing tags following WordPress coding standards
 * Better error handling and edge case management

#### 1.0.1

 * Fixed variable escaping for WordPress.org security standards
 * Updated all function and variable names to use unique prefixes
 * Improved code structure and security
 * Added external JavaScript file for better performance
 * Enhanced popup functionality
 * Better error handling

#### 1.0.0

 * Initial release
 * Template file name display
 * Directory path display
 * Basic configuration options
 * Popup showing included files
 * Position and color customization

## 额外信息

 *  版本 **1.1.0**
 *  最后更新：**10 月前**
 *  活跃安装数量 **20+**
 *  WordPress 版本 ** 5.0 或更高版本 **
 *  已测试的最高版本为 **6.8.5**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/current-page-template-viewer/)
 * 标签
 * [debug](https://cn.wordpress.org/plugins/tags/debug/)[developer](https://cn.wordpress.org/plugins/tags/developer/)
   [development](https://cn.wordpress.org/plugins/tags/development/)[template](https://cn.wordpress.org/plugins/tags/template/)
   [theme](https://cn.wordpress.org/plugins/tags/theme/)
 *  [高级视图](https://cn.wordpress.org/plugins/current-page-template-viewer/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/current-page-template-viewer/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/current-page-template-viewer/reviews/)

## 贡献者

 *   [ Nagaoka Design ](https://profiles.wordpress.org/nagaokadesign/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/current-page-template-viewer/)