[WordPress] 外掛分享: Simple Short Links

前言介紹

  • 這款 WordPress 外掛「Simple Short Links」是 2009-12-26 上架。
  • 目前有 40 個安裝啟用數。
  • 上一次更新是 2014-04-10,距離現在已有 4041 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

miqrogroove |

外掛標籤

link | links | short | shortlink | shortlinks |

內容簡介

從 WordPress 3.0 開始,此外掛的大部分原始功能已經納入 WordPress 中。WordPress 會預設在大多數頁面上增加短網址。此外掛僅添加一個設定頁面,讓您可以輕鬆進行一些微小的調整。

WordPress 短網址非常適合微型博客使用,您可以使用自己的網域而不是第三方短網址服務。

URL 會自動添加到每篇文章、頁面、附件和類別的 HTTP 和 HTML 首標,

使用模板標籤可以顯示人類可讀的連結,除了自動生成的表頭外。強烈推薦使用人類可讀的連結,因為 Google 會優先考慮該連結並將其排名高於某些較長的 URL。這樣可以提高被 Google 認定為“太長”的 URL 的排名。此外,在許多行動 Web 瀏覽器中,訪問者最容易找到短網址的方式就是在頁面的某個位置看到它。

通過為打印媒體添加 CSS 代碼,可以進一步擴展模板標籤的功能,這可以確保每篇文章的短鏈接 URL 與文章一起打印。這會使用戶在閱讀硬拷貝後更容易返回文章。

主題

關於 Simple Short Links 提供的模板功能,目前的文檔應該在 函數參考/短鏈接中 找到。

這裡是 Simple Short Links 提供的模板功能的基本參考。 WordPress 3.0+ 用戶,請參閱 wp-includes/link-template.php 以了解更多有關 the_shortlink() 的詳細信息。

/**
* 用於顯示短鏈接的模板標籤
*
* 必須在"The Loop"中調用
*
* 如下面示例調用:
*
* @since 1.1
* @param string $text Optional 要顯示的連結文字或 HTML。預設為 'This is the short link.'。
* @param string $title Optional 連結提示文本。必須被消毒過。預設為已消毒的文章標題。
*/
function the_shortlink($text = '', $title = '');

第二個類似的標籤現在可用,以便在類別頁面上顯示自我引用的短鏈接。

/**
* 用於顯示類別的短鏈接的模板標籤
*
* 應在"The Loop"之外調用。
*
* 如使用下面示例調用:
*
* @since 1.3
* @param string $text Optional 要顯示的連結文字或 HTML。預設為 'This is the short link.'。
* @param string $title Optional 連結提示文本。必須被消毒過。預設為已消毒的類別名稱。
*/
function the_single_shortlink($text = '', $title = '');

CSS 打印技巧

試著在您的主題 CSS 檔添加像這樣的內容,以便在列印時顯示短鏈接的 URL。

@media print {
.shortlink a:link:after {
content: " " attr(href);
}
}

CSS 示例假定 the_shortlink() 在具有“shortlink”類屬性的 DIV 或 P 元素中使用。

原文外掛簡介

As of WordPress 3.0, most of this plugin’s original features have been incorporated into WordPress itself. WordPress adds shortlinks to most pages by default. This plugin simply adds a settings page where you can easily make some minor adjustments.
WordPress shortlinks are useful for micro-blogging, by using your own domain instead of a 3rd-party short URL service.
The URLs are automatically added to the HTTP and HTML headers of each post, page, attachment, and category.
A template tag enables you to display a human-readable link in addition to the automatically generated headers. Use of human-readable links is highly encouraged, because Google is known to favor them and rank them higher than some longer URLs. This has the effect of boosting the rank of URLs that were deemed “too long” by Google’s standards. Also, in many mobile web browsers, the easiest way for a visitor to find a short link is by seeing it somewhere on the page.
The template tag idea can be extended further with CSS code for print media, which could ensure that each article’s short link URL is printed along with the article. This will make it much easier for the user to return to the article after reading a hard copy.
Theme
Current documentation should be found at Function Reference/the shortlink
Here is a basic reference for the template functions provided by Simple Short Links. WordPress 3.0+ users, see also wp-includes/link-template.php for more details about the_shortlink().
/**
* Template Tag for Displaying the Short Link
*
* Must be called from inside "The Loop"
*
* Call like
*
* @since 1.1
* @param string $text Optional The link text or HTML to be displayed. Defaults to 'This is the short link.'
* @param string $title Optional The tooltip for the link. Must be sanitized. Defaults to the sanitized post title.
*/
function the_shortlink($text = '', $title = '');

A second, similar tag is now available in case you need to display a self-referring short link on a category page.
/**
* Template Tag for Displaying the Short Link for a Category
*
* Should be called from outside "The Loop"
*
* Call like the_single_shortlink(__('Shortlinkage FTW')); ?>
*
* @since 1.3
* @param string $text Optional The link text or HTML to be displayed. Defaults to 'This is the short link.'
* @param string $title Optional The tooltip for the link. Must be sanitized. Defaults to the sanitized category name.
*/
function the_single_shortlink($text = '', $title = '');

The CSS Printing Trick
Try adding something like this to your theme’s CSS file to make the URL for the short link appear when printed.
@media print {
.shortlink a:link:after {
content: " " attr(href);
}
}

The CSS example assumes the_shortlink() is used inside of a DIV or P element with a class attribute called “shortlink”.

各版本下載點

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

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


1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.4.1 | 1.6.1 | trunk |

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

  • Page Links To 》這個外掛可以讓你將 WordPress 的頁面(或文章或自訂文章類型)連結至你選擇的 URL,而非 WordPress 的 URL。此外,它還會將前往舊的 URL(或「正常」的 URL...。
  • Custom Post Type Permalinks 》自訂文章類型永久連結允許您編輯自訂文章類型的永久連結結構。, 更改自訂分類目錄的永久鏈接,以“example.org/post_type/taxonomy_name/term_slug̶...。
  • Custom Permalinks 》name or slug), add the filter that looks like this:, function yasglobal_exclude_posts( $post ) {, // Replace '2' with ID of the post you want to ...。
  • VK Link Target Controller 》外掛介紹, VK Link Target Controller 外掛可在最近文章列表或存檔頁面中,讓使用者點選文章標題時轉址到其他網頁而非文章內容頁面。, 使用範例, 假設你在 eB...。
  • Title and Nofollow For Links (Classic Editor) 》這個外掛程式在插入連結彈出框中恢復了 WordPress 4.2 中刪除的「Title」欄位,並新增了一個「將連結加上 rel="nofollow"」的勾選框。, Gutengerg(區塊編輯...。
  • Flexy Breadcrumb 》PressTigers 的 Flexy Breadcrumb 是一個簡單而強大的麵包屑導覽系統外掛,適用於 WordPress 網站。使用此外掛,您可以透過 [flexy_breadcrumb] 短碼在網站的...。
  • Nofollow for external link 》這個外掛可以自動為您網站文章、頁面或主題菜單中所有外部連結插入 rel=nofollow 和 target=_blank。, 您也可以設置要排除的域名,選擇不為特定外部連結添加 ...。
  • Link Library 》此外掛用於在您的網站上建立一個頁面,列出 WordPress 管理介面內的 "連結" 部分中所定義的所有連結分類及其內所包含的所有連結。使用者可以選擇是否顯示某些...。
  • Link Juice Keeper 》錯誤 404 ( 找不到頁面 ) 很常見,也是造成搜尋引擎,例如 Google,把網站排名降低的主要原因之一。處理 404 錯誤對於非技術人員來說可能相當複雜。有了這個...。
  • rus to lat advanced 》這款 WordPress 外掛將俄文標題的文件名和連結(從標題中建立)轉換為拉丁字母。俄文標題的文件名和連結在 WordPress 中儲存時經常是不正確的。, 例如,在標...。
  • Custom Meta Widget 》這個外掛的功能和 WordPress 標準的 Meta widget 完全相同,除了它增加了選項來控制要顯示哪些 5 個標準的 Meta widget 連結,並提供一個新增自訂連結的選項...。
  • Autologin Links 》這個外掛讓管理員可以為其 WordPress 網站生成自動登入連結,並以特定使用者名稱登入訪客。管理員可以編輯(生成和刪除)使用者的自動登入連結,而使用者只能...。
  • Track The Click 》追踪點擊次數, Track The Click 外掛能夠幫助網站擁有者更好地了解網站訪客與網站上連結的互動情形。這款外掛主要功能是即時追踪 WordPress 網站上發生的點擊...。
  • Sape – website monetization 》這個外掛程式能夠自動將 Sape 系統的程式碼安裝到網站上。, 這是一個從 Sape 取得利益的網站收益外掛程式。此外掛支援以下的網站收益方式:, , 租借連結, 全...。
  • Ambrosite Next/Previous Post Link Plus 》重要提示:請確保使用正確的外掛程式。, , Next/Previous Post Link Plus 外掛程式適用於單篇文章模板。, Next/Previous Page Link Plus 外掛程式適用於頁面...。

文章
Filter
Apply Filters
Mastodon