[WordPress] 外掛分享: Enqueueror

首頁外掛目錄 › Enqueueror
WordPress 外掛 Enqueueror 的封面圖片
100+
安裝啟用
★★★★★
5/5 分(2 則評價)
608 天前
最後更新
問題解決
WordPress 5.0+ PHP 7.1+ v1.4.0 上架:2022-01-08

內容簡介

Enqueueror是一個外掛程式,協助WordPress開發人員以更有組織和有效率的方式載入JavaScript和CSS程式碼。此外,此外掛可讓WordPress開發人員將腳本和樣式表資源組織到目錄中,使用檔案命名慣例,具備自動包含資源功能,視所需內容而定。此外,Enqueueror支援使用PHP生成和輸出JavaScript和CSS程式碼,使用PHP編程語言作為預處理器。

快速入門範例

全域載入樣式表
在樣式表目錄中編寫一個名為global.css的CSS檔案。

僅在查看具有id = 1的頁面時載入樣式表
在樣式表目錄中為CSS檔案命名為type-page-id-1.css或type-id-1.css。

僅在查看具有slug = 'example-page'的頁面時載入樣式表
在樣式表目錄中為CSS檔案命名為type-page-slug-example-page.css或type-slug-example-page.css。

僅在查看具有id = 1的分類詞時載入樣式表
在樣式表目錄中為CSS檔案命名為tax-category-term-id-1.css或term-id-1.css。

僅在查看具有slug = 'category1'的分類詞時載入樣式表
在樣式表目錄中為CSS檔案命名為tax-category-term-slug-category1.css或term-slug-category1.css。

指南

您可以在GitHub閱讀指南。

用法

安裝Enqueueror
請參閱GitHub中的指南

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.4.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Enqueueror」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Enqueueror empowers WordPress developers to manage and develop their CSS & JavaScript files efficiently. It facilitates conditional CSS & JavaScript loading through the use of naming conventions and provides numerous features to enhance the code development workflow.
Quick Start Examples

Load a stylesheet globally
Code a CSS file named global.css in the stylesheets directory.

Load a stylesheet only when viewing the page with id = 1
Code a CSS file named type-page-id-1.css or type-id-1.css in the stylesheets directory.

Load a stylesheet only when viewing the page with slug = ‘example-page’
Code a CSS file named type-page-slug-example-page.css or type-slug-example-page.css in the stylesheets directory.

Load a stylesheet only when viewing the category term with id = 1
Code a CSS file named tax-category-term-id-1.css or term-id-1.css in the stylesheets directory.

Load a stylesheet only when viewing the category term with slug = ‘category1’
Code a CSS file named tax-category-term-slug-category1.css or term-slug-category1.css in the stylesheets directory.

Guide
You may read the guide at GitHub.
Usage

Install Enqueueror.
Create the scripts and stylesheets directories under the active theme’s root directory.
Consult the guide at GitHub.

延伸相關外掛

文章
Filter
Mastodon