[WordPress] 外掛分享: Reveal Template

WordPress 外掛 Reveal Template 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Reveal Template」是 2009-06-11 上架。 目前已經下架不再更新,不建議安裝使用。
  • 目前有 1000 個安裝啟用數。
  • 上一次更新是 2021-11-15,距離現在已有 1266 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.9 以上版本才可以安裝。
  • 有 16 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

coffee2code |

外掛標籤

debug | theme | template | presentation |

內容簡介

設計師和開發人員知道,在 WordPress 中確定當前頁面使用的模板有時可能會讓人困惑和沮喪。有時會存在頁面或分類特定模板,或者文章作者已經設定了使用特定模板,或者當前主題沒有使用特定模板,導致 WordPress 回退到其他模板。

本外掛程序通過顯示用於呈現當前 WordPress 頁面的模板,緩解了設計師和開發人員的這種煩惱。以下是顯示方法:

管理列
默認情況下,在管理列中顯示了用於呈現該頁面的主題相關路徑。外掛程式的設置頁面位於“設計”-> “顯示模板”,允許您控制和配置特定方法。注意:即使通過設置啟用,管理列條目也只有在管理列顯示並且用戶有能力看到顯示的模板時才出現。

網站頁腳
默認情況下,在網站的頁腳中顯示了用於呈現該頁面的主題相關路徑。外掛程式的設置頁面位於“設計”-> “顯示模板”,允許您控制和配置特定方法。注意:即使通過設置啟用,頁腳輸出只有在主題遵循調用 wp_footer() 模板標簽的推薦做法以及用戶有能力看到顯示的模板時才出現。

小工具
提供了一個名為“顯示模板”的小工具,可以在任何小工具區域用於顯示用於呈現該頁面的主題相關路徑。

短程式碼
提供一個名為“revealtemplate”的短程式碼,可以在文章/頁面內容中使用,以顯示用於呈現該頁面的主題相關路徑。目前它支持兩個可能的屬性:

‘admin’:可以是1或0,表示模板名稱是否只向管理員顯示。 1表示僅顯示給管理員,0表示顯示給所有訪問者。默認值為1。
‘type’:模板路徑類型。必須是“absolute”、“filename”、“relative”或“theme-relative”中的一種。閱讀說明文件以獲取有關每個內容的更多信息。

例如:[revealtemplate type="absolute"],[revealtemplate type="filename" admin="0"]

模板標籤
也提供了一個模板標籤,可用於顯示用於呈現該頁面的主題相關路徑。

默認情況下,c2c_reveal_template() 將顯示模板名稱。要僅獲取模板文件名,而不是顯示它:

模板標籤還接受第二個參數,可以是以下之一:absolute、relative、theme-relative、filename。這決定了您想要報告的路徑風格。如果未指定,它將使用外掛程式設置頁面中定義的默認值。

路徑類型的示例:

“absolute”:/usr/local/www/yoursite/wp-content/themes/yourtheme/single.php
“relative”:wp-content/themes/yourtheme/single.php
“theme-relative”:yourtheme/single.php
“filename”:single.php

此外掛程式主要是打算根据需要啟用。

原文外掛簡介

Designers and developers know that it can sometimes be confusing and frustrating to determine the exact template being utilized to render the currently displayed page in WordPress. Sometimes page or category specific templates exist, or a page/post has been set by the post author to use a particular template, or the current theme doesn’t employ certain templates causing WordPress to fall back to others.
This plugin relieves that aggravation by assisting designers and developers by displaying the template being used to render the currently displayed page in WordPress. This can be shown in one or more of the following methods:
Admin bar
By default, the theme-relative path to the theme template file used to render the page is shown in the admin bar. The settings page for the plugin, at ‘Design’ -> ‘Reveal Template’, allows you to control and configure this particular method. Note: even if enabled by the setting, the admin bar entry also only appears if the admin bar is showing and if the user has the ability to see the revealed template.
Site footer
By default, the theme-relative path to the theme template file used to render the page is shown in the site’s footer. The settings page for the plugin, at ‘Design’ -> ‘Reveal Template’, allows you to control and configure this particular method. Note: even if enabled by the setting, the footer output only appears if the theme follows the recommended practice of calling the wp_footer() template tag at some point and the user has the ability to see the revealed template.
Widget
A widget named “Reveal Template” is made available which can be used to display the theme template file used to render the page in any widget location.
Shortcode
A shortcode called ‘revealtemplate’ is made available which can be used in post/page content to display the theme template file used to render the page. Currently it supports two possible attributes:

‘admin’ : Can either be 1 or 0 to indicate if the template name should be revealed to admins only. 1 means to admins only, 0 to all visitors. The default is 1.
‘type’ : The template path types. Must be one of ‘absolute’, ‘filename’, ‘relative’, or ‘theme-relative’. Read the documentation for more information on what each of these mean.

Examples: [revealtemplate type="absolute"], [revealtemplate type="filename" admin="0"]
Template Tag
A template tag is also provided which can be used to display the theme template file used to render the page.

By default, c2c_reveal_template() will echo the template name. To simply retrieve the template filename rather than displaying it:

The template tag also takes a second argument which be can be one of the following: absolute, relative, theme-relative, filename. This determines the path style you’d like reported. If not specified, it uses the default defined in the plugin’s settings page.
Examples of path types:

“absolute” : /usr/local/www/yoursite/wp-content/themes/yourtheme/single.php
“relative” : wp-content/themes/yourtheme/single.php
“theme-relative” : yourtheme/single.php
“filename” : single.php

This plugin is primarily intended to be activated on an as-needed basis.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Template Tags
The plugin provides one template tag for use in your theme templates, functions.php, or plugins.
Functions


Formats for output the template path info for the currently rendered template.

Arguments

$echo (bool)
Optional. Echo the template info? Default is true.

$template_path_type (string)
Optional. The style of the template’s path for return. Accepts: ‘absolute’, ‘relative’, ‘theme-relative’, ‘filename’. Default is ”, which causes the function to use the template path type configured via the plugin’s settings page.

Examples

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Reveal Template」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


2.0 | 2.1 | 2.2 | 2.3 | 3.0 | 3.1 | 3.2 | 3.3 | 3.4 | 3.5 | 3.6 | 3.7 | 1.0.1 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 3.1.1 | 3.4.1 | 3.4.2 | 3.6.1 | trunk |

延伸相關外掛(你可能也想知道)

  • Kirki Customizer Framework 》 , 新增 -現在可使用 Kirki PRO , Kirki讓佈景主題開發者更快速、更輕鬆建立佈景主題。, Kirki 提供超過 30 個自訂控制,範圍從簡單的滑桿到具有 Google ...。
  • Child Theme Configurator 》res and options to help you take complete control of your WordPress site's visual appearance. With PRO, you can handle any plugin's CSS styles, pre...。
  • Easy Theme and Plugin Upgrades 》WordPress 具有透過提供壓縮檔案安裝主題和外掛的內置功能。不幸的是,您無法使用相同的過程升級主題或外掛。相反,當試圖使用壓縮檔案升級時,WordPress 會...。
  • Widget Shortcode 》這個短碼需要小工具的ID,但不需要猜測,外掛會為你生成代碼。如果你想要覆蓋小工具的標題,你可以使用 "title" 參數:, [widget id=”text-1″...。
  • All In One Favicon 》查看最新的WordPress交易以優化您的網站。, All In One Favicon為您的網站和管理頁面添加favicon。, 您可以使用您已經上傳的favicon或使用內置的上傳機制將fa...。
  • Theme Editor 》主題編輯器 (Theme Editor) 允許您編輯主題文件、建立資料夾、上傳檔案,以及在主題和外掛中移除任何檔案和資料夾。您可以直接自訂主題和外掛。, 升級至專業...。
  • Download Plugins and Themes in ZIP from Dashboard 》在儀表板下載外掛和佈景主題外掛可讓您直接從管理儀表板下載已安裝的外掛和佈景主題 ZIP 檔案而無需使用 FTP。, 外掛中沒有必須的設置 - 安裝後,所有以下 Do...。
  • Cryout Serious Theme Settings 》這個外掛是為了與我們的 Nirvana、Tempera、Parabola 和 Mantra 主題互相運作,並在目前的 WordPress 版本上啟用其進階設定頁面。, 相容性, 無論 WordPress ...。
  • WP Updates Notifier 》這個外掛程式會監控你的 WordPress 安裝,並會在核心、外掛程式和佈景主題更新時發送電子郵件通知你。如果你不經常登入 WordPress 管理員,或支援客戶的網站...。
  • Disable auto-update Email Notifications 》自 WordPress 5.5 起,若您已啟用外掛或佈景主題自動更新功能,當外掛或佈景主題自動更新成功或失敗時,您將會收到一封電子郵件通知。, 如果你管理多個網站,...。
  • WP Child Theme Generator 》WP子佈景主題產生器是一個非常簡單易用的外掛,可用於為WordPress CMS支援的任何佈景主題創建子佈景主題。使用多種選項創建子佈景主題,您可以輕鬆地創建和自...。
  • Multi Device Switcher 》Multi Device Switcher外掛允許您為設備(智能手機、平板電腦、手機、遊戲和自定義)設置單獨的佈景主題。, 此外掛可以偵測到使用者代理(UserAgent)是否正在...。
  • Multiple Themes 》重要提示:支援服務已移至 ZATZLabs 網站,不再於 WordPress.org 論壇提供。如需開發者迅速回覆,請提交請求單。, 此外掛設定提供多種選擇方式,可讓您選擇要...。
  • Disable All WordPress Updates 》這個外掛可以完全停用 WordPress 的主題、外掛和核心更新檢查系統。該插件防止 WordPress 檢查更新,包括 cronjobs,並防止顯示任何通知訊息。, 很重要的是,...。
  • WP-LESS 》LESS 是一種基於 CSS 的樣板語言。它提供了許多增強功能,以加速開發並使維護更容易。, 主題開發人員甚至可以捆綁該外掛而不用擔心衝突:只需包含特殊的 boot...。

文章
Filter
Apply Filters
Mastodon