[WordPress] 外掛分享: Snippet Shortcodes

首頁外掛目錄 › Snippet Shortcodes
WordPress 外掛 Snippet Shortcodes 的封面圖片
4,000+
安裝啟用
★★★★
4.7/5 分(25 則評價)
291 天前
最後更新
問題解決
WordPress 6.0+ PHP 7.4+ v5.1.2 上架:2015-07-20

內容簡介

文件/升級

Snippet Shortcodes 網站

Snippet Shortcodes 是什麼?

您是否想在整個網站上使用相同的文本片段或 HTML 片段,但只需在一個位置更改值?如果是,則此外掛可能正是您需要的。

創建您自己的短代碼並將內容分配給它們。使用標準的 WP 編輯器,您可以添加文本、HTML、JavaScript、圖像或其他您的 WordPress 安裝和外掛允許的元素。其主要優點在於能夠創建一個短代碼,並在整個網站上重複使用它。

[ sv slug=”您的 slug 名稱”]

特點

創建一次短代碼,並放置在多個位置。
在一個位置更新短代碼,它會在整個網站上更改。
參數可擴展您的短代碼。
免費和付費輔助短代碼使生活更輕鬆。
多站點支持。
處理短代碼在 WordPress 菜單標題中。

指定參數

在某些情況下,您可能希望使您的短代碼更易擴展。這就是參數發揮作用的地方。例如,您可能有一個渲染 HTML 表格的短代碼,但是,根據您在網站上放置該短代碼的位置,您可能希望指定其他參數。請看以下示例,您可以看到通過短代碼傳遞的其他參數,“border”、“background”等。

[ sv slug=”render-table” border=”0″ background=”#FFFFFF” width=”50%” site-title=”YeKen”]

每個參數都可以在短代碼中呈現,使用以下語法 %%background%%、%%width%% 等。以下是一個示例:

歡迎來到我們的網站,%%site-title%%。

高級短代碼

該外掛附帶以下高級短代碼:

sc-date- 短代碼顯示今天的日期,並具有添加或減去幾天、幾個月和幾年的能力。要指定要添加或減去到日期的間隔,使用參數“interval”,例如 [sv slug=”sc-date” interval=”-1 year”],[sv slug=”sc-date” interval=”+5 days”],[sv slug=”sc-date” interval=”+3 months”]。間隔基於 PHP 間隔,可以在此處說明:https://www.php.net/manual/en/dateinterval.createfromdatestring.php。預設為英國格式(DD/MM/YYYY)。可以通過在短代碼上添加參數格式=”m/d/Y” 來更改格式。格式語法基於 PHP 日期:http://php.net/manual/en/function.date.php
sc-site-language - 當前網站的語言代碼
sc-site-description - 網站標語(設置在“設定”>“常規”中)
sc-site-wp-url - WordPress 位址(URL)(設置在“設定”>“常規”中)
sc-site-charset - 頁面和饋送的編碼(設置在“設定”>“閱讀”中)
sc-site-wp-version - 當前 WordPress 版本
sc-site-html-type - 內容類型(默認值:“text/html”)。主題和外掛
sc-site-stylesheet-url - 活動主題樣式表的 URL。
sc-site-stylesheet_directory - 活動主題的目錄路徑。
sc-site-template-url - 活動主題目錄的 URL。
sc-site-current-url - 當前 URL。
sc-site-register-url - Wo

外掛標籤

開發者團隊

⬇ 下載最新版 (v5.1.2) 或搜尋安裝

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

原文外掛簡介

Create a library of custom shortcodes and reusable content, and seamlessly insert them into your posts and pages for streamlined, consistent site updates. Plus, get a head start with a built-in selection of ready-made shortcodes to use out of the box.

In addition to inserting them into your content, you can also configure them to automatically appear in your site’s header and footer. Or limit their display to desktop or mobile devices only.
Looking to reuse the same snippet of text or HTML across your website while only updating it in one spot? Snippet Shortcodes could be exactly what you need. With this tool, you can generate a library of custom shortcodes and embed them into your WordPress content. Using the familiar WordPress editor, you can insert anything from text and HTML to JavaScript, images, or any other elements supported by your theme or plugins. The biggest benefit? You only need to create the shortcode once, and you can then deploy it site-wide, saving time and ensuring consistency.
Quick example
By default, you tend to create content once and then copy and paste it across your site as needed. Later, when updates are required, you have to track down every instance, edit each one individually, and save every page or post – making consistent updates a tedious process. Instead, put a snippet like this into one of our custom shortcodes and get a shortcode you can paste into your content. To update, all you need to do is edit the custom shortcode and your entire site will update consistently.
Our Facebook

to
[sv slug="facebook-link"]

Basic Features

Custom shortcodes – Create up to 10 custom shortcodes that can be embedded throughout your website.
Parameters – Enhance your shortcodes by passing parameters into them e.g. [ sv slug=”logo” color=”blue” ]
Ready made shortcodes – A collection of ready-made shortcodes for displaying common WordPress fields such as site title, username, admin email, etc.
HTML editor – a HTML editor for editing your custom shortcodes.

Premium Features

Automatically insert into your site’s header or footer – auto insert your custom shortcode’s content into either your site’s header and/or footer.
Limit to certain device types – specify whether your custom shortcode should only be visible on Mobile, Tablet, Desktop or all three.
No limits – create unlimited custom shortcodes.
Inline editor – Ability to edit custom shortcodes quickly using the inline editor.
Duplicator – Ability to duplicate custom shortcodes with one button click.
Enable/Disable – Ability to enable or disable custom shortcodes.
Multi-site – use custom shortcodes throughout your entire multi-site, not just limited to the one child site.
CSV import – Bulk import your custom shortcodes.
WooCommerce fields – A ready-made shortcode to display WooCommerce fields.
Fetch values from database – A ready-made shortcode to fetch a value from any database table.
An enhanced collection of ready-made shortcodes for displaying additional WordPress fields, as well as wrapping around PHP functionality like GET/POST values, number of users, etc.

Pricing Plans
We’re very transparent on our pricing and usually offer two plans: yearly and lifetime. For further information, please visit our upgrade page.
Getting support
If you have a question or an issue, please ask on the plugin’s WordPress support page, and we’ll be more than happy to help.
Useful links

Snippet Shortcodes – Premium – main website for the Premium plugin.
Snippet Shortcodes – Core – WordPress.org page for the core plugin.
Technical Documentation – Installation and detailed documentation on how to use the plugin.
Trial license – Get a trial license to try out all the features.
Upgrade – purchase a license to receive all of the features.

延伸相關外掛

文章
Filter
Mastodon