內容簡介
功能
為文章提供「讚」的按鈕
在文章中顯示讚數
自訂讚數的標籤文字
全站關閉讚數文字標籤
可選擇「大拇指」或「愛心」的圖示
限制特定文章類型的按讚功能
關閉外掛的 CSS 或加入自訂樣式規則
預設情況下,讚數會在所有文章類型的個別文章內容下方顯示。您可以在外掛設定中關閉此功能或定義要包含的文章類型。
如果您想在模板檔案中顯示讚數,可以使用以下程式碼:
<?php
if( function_exists('wp_recommend_show_likes') )
wp_recommend_show_likes();
?>
短碼
下列短碼可顯示任何文章的讚數。
[recommend-likes]
下列短碼可顯示讚數最多的文章清單。有兩個選用的參數可以微調顯示結果:「文章類型(post_type)」和「每頁文章數(posts_per_page)」。以下範例顯示這些參數的預設值。
[recommend-liked-posts post_type="post" posts_per_page="5"]
外掛標籤
開發者團隊
原文外掛簡介
Features
Give users a “like” action on posts
Display the like count on a post
Custom label text for like count
Disable label text for count site-wide
Choose between a “Thumbs Up” or a “Heart” icon
Limit like action to specific post types
Disable plugin CSS or add custom styling rules
By default, the like count will be displayed below the content for individual posts across all post types. You can disable this in the plugin settings or define which post types to include.
If you’d rather display the like count in your template files, use the below code:
Shortcodes
The following shortcode will display the like count on any post.
[recommend-likes]
The following shortcode will display a list of most liked posts. There are two optional parameters to fine tune the displayed results: post_type and posts_per_page. The default values for these parameters are shown in the example below.
[recommend-liked-posts post_type="post" posts_per_page="5"]
