內容簡介
輕鬆地將 Pinterest 資源添加到您的 WordPress 網站中,包括「按一下釘選」、「Follow」按鈕和 Pinboard。
連結:外掛 FAQ 和新聞
[為避免外掛問題,需要使用 PHP5]
簡碼
按一下釘選按鈕
– 簡碼:[pinit]
– 參數:layout // 按鈕佈局
– 用法:[pinit layout=”horizontal|vertical|none”]
Pinterest 追蹤按鈕
- 簡碼:[pinme]
- 參數:username、layout // Pinterest 使用者名稱、按鈕佈局
- 用法:[pinme username="your_pinterest_username" layout="large-white | medium-white | icon-white | tiny-white | large-red | medium-red | icon-red | tiny-red | icon-text"]
Pinterest Pinboard
- 簡碼:[pinboard]
- 參數:username、board、pins、width、height、maxheight、description、follow、columns // Pinterest 使用者名稱、Pinboard 名稱、要顯示的釘選數量、釘選寬度、釘選高度、釘選最大高度、顯示或隱藏說明文字、在 Pinboard 下顯示 Follow 連結、釘選顯示的欄位數
- 用法:[pinboard username="your_pinterest_username" board="your_pinterest_board_name" pins="number_of_pins_to_display" width="width_of_a_pin" height="height_of_a_pin" maxheight="maximum_height_of_a_pin" description="0 | 1" follow="large-white | medium-white | icon-white | tiny-white | large-red | medium-red | icon-red | tiny-red | icon-text | icon-text-red | icon-text-white | none" columns="number_of_columns_for_pinboard"]<h3>PHP 函式</h3>
按一下釘選按鈕
函式:wp_pinterest_pin_it_button
參數:$layout // 按鈕佈局
用法:`<?php wp_pinterest_pin_it_button('horizontal | vertical | none'); ?>`
Pinterest 追蹤按鈕
函式:wp_pinterest_follow_button
參數:$username、$layout // Pinterest 使用者名稱、按鈕佈局
用法:`<?php wp_pinterest_follow_button('your_pinterest_username', 'large-white | medium-white | icon-white | tiny-white | large-red | medium-red | icon-red | tiny-red'); ?>`
Pinterest Pinboard
函式:wp_pinterest_pinboard
參數:$username、$board、$pins、$width、$height、$maxheight、$description、$follow、$columns // Pinterest 使用者名稱、Pinboard 名稱、要顯示的釘選數量、釘選寬度、釘選高度、釘選最大高度、顯示或隱藏說明文字、在 Pinboard 下顯示 Follow 連結、釘選顯示的欄位數
用法:`<?php wp_pinterest_pinboard('your_pinterest_username', 'your_pinterest_board_name', 'number_of_pins_to_display', 'width_of_a_pin', 'height_of_a_pin', 'maximum_height_of_a_pin', '0 | 1', 'large-white | medium-white | icon-white | tiny-white | large-red | medium-red | icon-red | tiny-red | icon-text | icon-text-red | icon-text-white | none', 'number_of_columns_for_pinboard'); ?>`
= 注意:參數「pins」、「width」、「height」、「maxheight」及「columns」,只能輸入整數值。參數「description」控制 Pinboard 上的釘選標題是否顯示,為二進制參數,必須提供值「0」(false)或「1」(true)。按照下面的示例在 WordPress 主題中使用 PHP 函式,實現最佳實踐:
<?php if(function_exists('wp_pinterest_follow_button')) echo wp_pinterest_follow_button('your_pinterest_username', 'large-white | medium-white | icon-white | tiny-white | large-red | medium-red | icon-red | tiny-red'); ?>
外掛標籤
開發者團隊
原文外掛簡介
Add Pinterest assets like Pin-it button, Follow button and Pinboard to your WordPress site without hassle.
Links: Plugin FAQ and News
[PHP5 is required to avoid any problems with the plugin]
Shortcodes
Pin-it button
– Shortcode : [pinit]
– Parameters : layout // Button Layout
– Usage : [pinit layout=”horizontal|vertical|none”]
Pinterest Follow button
- Shortcode : [pinme]
- Parameters : username, layout // Pinterest Username, Button Layout
- Usage : [pinme username="your_pinterest_username" layout="large-white | medium-white | icon-white | tiny-white | large-red | medium-red | icon-red | tiny-red | icon-text"]
Pinterest Pinboard
- Shortcode : [pinboard]
- Parameters : username, board, pins, width, height, maxheight, description, follow, columns // Pinterest Username, Pinboard Name, Number of Pins to display, Pin width, Pin height, Pin maximum height, Show or hide description, Follow link below the Pinboard, Number of Columns the Pinboard should have
- Usage : [pinboard username="your_pinterest_username" board="your_pinterest_board_name" pins="number_of_pins_to_display" width="width_of_a_pin" height="height_of_a_pin" maxheight="maximum_height_of_a_pin" description="0 | 1" follow="large-white | medium-white | icon-white | tiny-white | large-red | medium-red | icon-red | tiny-red | icon-text | icon-text-red | icon-text-white | none" columns="number_of_columns_for_pinboard"]
PHP functions
Pin-it button
Function : wp_pinterest_pin_it_button
Parameters : $layout // Button Layout
Usage : ``
Pinterest Follow button
Function : wp_pinterest_follow_button
Parameters : $username, $layout // Pinterest Username, Button Layout
Usage : ``
Pinterest Pinboard
Function : wp_pinterest_pinboard
Parameters : $username, $board, $pins, $width, $height, $maxheight, $description, $follow, $columns // Pinterest Username, Pinboard Name, Number of Pins to display, Pin width, Pin height, Pin maximum height, Show or hide description, Follow link below the Pinboard, Number of Columns the Pinboard should have
Usage : ``
= NOTE: The parameters 'pins', 'width', 'height', 'maxheight', 'columns' should be supplied an integer value only. Parameter 'description', which controls showing/hiding of Pin title on Pinboard, is a binary parameter which should be provided with a value either '0' (false) or '1' (true).
Implement the best practice to use PHP functions in your WordPress Theme by following the below given example:
