[WordPress] 外掛分享: Basic URL ShortCodes

首頁外掛目錄 › Basic URL ShortCodes
3,000+
安裝啟用
★★★★★
5/5 分(2 則評價)
18 天前
最後更新
問題解決
WordPress 4.0.0+ v4.0.2 上架:2017-07-19

內容簡介

有時候,您想在內容編輯器中放置基本網址(博客的網址,或活動範本的網址)。這種情況下,自定義範本功能可能不夠靈活。
使用此外掛,您可以使用 [home_url] 將博客的基本網址(根據您的設置)輸出到內容中。或者,您可以使用[theme_url_template]輸出活動範本的網址。也可以使用 [UPLOAD_URL] 輸出上傳資料夾的網址。

例如在您的編輯器中使用 <img src="[UPLOAD_URL]/2022/02/test.png /> 可以輸出 <img src="http://localhost/wp-demo/wp-content/uploads/2022/02/test.png" />(如果 http://localhost/wp-demo 是您在設置中設置的博客網址)。

支援的簡碼如下:
* [home_url] – 已設置的博客網址(設置在設置中)。例如 http://localhost/wp-demo
* [theme_url_template] – 活動範本的網址。例如 http://localhost/wp-demo/wp-content/themes/mytheme
* [UPLOAD_URL] – 上傳文件夾的網址。例如 http://localhost/wp-demo/wp-content/uploads

授權
此外掛使用 GPLv3 授權。

外掛標籤

開發者團隊

⬇ 下載最新版 (v4.0.2) 或搜尋安裝

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

原文外掛簡介

Sometimes you need to display your website’s base URL, active theme URL or uploads folder URL directly inside your content editor.
Basic URL Shortcodes allows you to easily insert important WordPress URLs using simple shortcodes inside posts, pages and widgets.
Available Shortcodes
[home_url]
Outputs the website’s home URL (as set in WordPress Settings).
Example:
http://localhost/wp-demo
[theme_url_template]
Outputs the URL of the currently active theme (child theme supported).
Example:
http://localhost/wp-demo/wp-content/themes/mytheme
[UPLOAD_URL]
Outputs the base URL of the WordPress uploads directory.
Example:
http://localhost/wp-demo/wp-content/uploads
These shortcodes are useful when building custom layouts, inserting dynamic links or when theme customization options are limited.
Lightweight, simple and fully compatible with modern WordPress editors.
License
This plugin uses the GPLv3 license.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon