[WordPress] 外掛分享: K2 Style Switcher

前言介紹

  • 這款 WordPress 外掛「K2 Style Switcher」是 2008-02-26 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2010-06-15,距離現在已有 5437 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.8 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

xenlab | thecuriousfrog |

外掛標籤

k2 | style | theme | style switcher | Theme Switcher |

內容簡介

這個外掛可以讓使用者更改套用在 K2 佈景主題上的樣式選項,相當於佈景主題切換器。使用者可以從已選擇的 K2 樣式清單中重新設定您的網站主題,使您的網站風格更臻完美。您可以透過 URL、文章或頁面元數據、總體預設等方式指定給定文章或頁面應使用的預設 K2 樣式。

使用者所做的樣式選擇在其訪問期間將是持久的,並覆蓋預設值,但它們可以透過 URL 參數覆蓋。 若要停止使用此外掛程式但保留配置選項,可以在 WordPress「管理外掛程式」畫面使用「停用」連結。如果要完全卸載外掛程式,則使用WordPress「管理外掛程式」畫面中的「停用」連結,接著點選「刪除」連結。這樣可以刪除外掛程式檔案和您的配置選項。

此外掛包括一個小工具可顯示可用樣式的下拉式選單或無序清單。小工具標題和要使用的選單類型是在小工具選項中設定的。其他外掛程式選項是使用 K2 Style Switcher 管理面板 (「外觀」>「K2 Style Switcher」)設定的。

選擇套用於特定文章或頁面的風格可以使用以下方法之一:

1. 可以在頁面 URL 中附加參數,該參數包含風格的相對路徑,例如:http://example.com/?k2ss_target_style=style/style.css
2. 如果在 PHP 會話變數中已經設定了風格,則它將應用於文章或頁面。
3. 可以在頁面或文章中添加名為k2ss_default_style 的自訂欄位。該欄位值應設置為風格的相對路徑,例如:style/style.css
4. 如果上述方法都沒有設定樣式,則將套用在 K2 Style Switcher 管理面板中指定的預設樣式。

「預設樣式」選項設定來訪者在首次登陸您的網頁時所看到的K2樣式,除非在「使用方法」章節中描述的其中一種方法指定了另一種樣式。 選項「預設樣式選取器格式」設定呼叫時未設置參數時是使用的風格選取器格式。

如果選擇使用無序清單顯示風格選取器,則可以使用「.k2ss_selected」類樣式來設定目前選取的樣式的連結。例如:.k2ss_selected { border-left: 1px dashed #666; }

「Footer 選項的意思是:在您的網站頁尾上顯示相關文字,但必須每次重載頁面才能重新書寫這個文字。」選項中有一個列表可供參考,您可以點擊選項名稱(「Footer 選項」)查看可用的巨集列表,以及在執行時要替換巨集的資訊。 參數「顯示 WordPress footer」控制標準 WordPress footer 的可見度(「由 WordPress 和 K2 提供」)。如果您在自定義 footer 範本中放置相同的資訊,您可能希望隱藏此 footer。參數「顯示養料鏈接」控制養料鏈接的可見度。

原文外掛簡介

This plugin is the equivalent of a theme switcher for styles applied to the K2 theme. It allows your visitors to re-skin your site from a list of K2 styles that you select.
The default K2 style to be applied to a given post or page can be specified using a parameter added to the URL, post or page meta data, or an overall site default.
Style selections made by the user are persistent for the duration of their visit and override default values, however they can be overridden using a URL parameter.
Uninstallation

If you wish to stop using the plugin but keep your configuration options then simply use the ‘Deactivate’ link on the WordPress ‘Manage Plugins’ screen
If you wish to completely uninstall the plugin then use the ‘Deactivate’ link followed by the ‘Delete’ link on the WordPress ‘Manage Plugins’ screen. This removes the plugin files and your configuration options

Usage
This plugin includes a widget that displays either a dropdown menu or an unordered list of the available styles. The title of the widget and the type of menu to use are set in the widget options.
The other plugin options are set using the K2 Style Switcher administration panel (‘Appearance’ > ‘K2 Style Switcher’).
The style to apply to a given post or page is chosen using one of the following methods:

A paramter can be appended to the page URL containing the relative path to the style, for example: http://example.com/?k2ss_target_style=style/style.css
If a style has already been set in the PHP sessions variables then it will be applied to the post or page
A custom field called k2ss_default_style can be added to the page or post. The field value should be set to the relative path to the style, for example: style/style.css
If none of the above methods have set the style then the default style specified in the K2 Style Switcher administration panel is applied

Configuration
Default Style
This option sets the K2 style that visitors will see upon first landing on your page unless another style has been specified using one of the methods described in the Usage section. Once they select a style, they will see that style instead.
Default Style Picker Format
This option sets the type of style picker that will be displayed when the function is called with no parameter set:

Unordered List – Displays a list of links
Dropdown Menu – Displays a dropdown menu

If you opt to use the unordered list when displaying the style picker you can style the link to the currently selected style using the .k2ss_selected class. For example: .k2ss_selected { border-left: 1px dashed #666; }
Footer Template
This option sets the text that is displayed in your site footer. This is re-written each time the page is loaded, meaning that it always displays information relevant to the style that the visitor is currently seeing.
For a list of the available macros click the option name (‘Footer Template’) on the administration panel. This will display the list of macros and the information they will be replaced with at runtime.
Display WordPress footer
This option controls the visibility of the standard WordPress footer (‘Powered by WordPress and K2’). You may wish to hide this footer if you are placing the same information in the custom footer template.
Display feed links
This option controls the visibility of the feed links footer (‘Entries Feed and Comments Feed’). You may wish to hide this footer if you are placing the same information in the custom footer template.
Display base styles footer
This option controls the visibility of the active styles K2 footer (‘Styled with by ‘). You probably wish to hide this footer as any base styles that are active will probably be tweaks that do not need crediting.
Display page stats
This option controls the visibility of the WordPress page loading stats footer (‘ queries. seconds.’). You may wish to show this information, it will appear just above the output of the custom footer template.
Available Styles
This option displays all the styles currently available in your K2 styles directory. Select the styles you want visitors to be able to use. Note that styles are only shown here if they are not currently in use by K2.
Any styles that are set as active on the K2 options screen will be used as base styles. This means they will be applied in addition to either the default K2 Style Switcher style or the style that the visitor has chosen. This allows any custom CSS snippets to be maintained in one place rather than being added to each style.
Release Notes

No known issues are present in this version

各版本下載點

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

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


1.0.0 | 1.1.0 | 1.1.1 | 1.1.2 |

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

  • OpenHook 》如果您對於編輯 PHP 檔案以自訂網站不是完全舒適的話,OpenHook 就是您所需要的!越來越多的佈景主題和外掛程式已配備了各種鉤子(hooks)-可以接收用戶自訂...。
  • K2 Hook Up 》K2 佈景主題提供了一些額外的模板鉤子。如果你精通 PHP,你可以輕鬆地向這 8 個區域添加任何形式的任意內容。對於其他人來說,就有 K2 Hook Up 插件。, 這個...。

文章
Filter
Apply Filters
Mastodon