php Pinterest“Pin It”按钮。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Pinterest“Pin It”按钮。相关的知识,希望对你有一定的参考价值。

/* Pinterest Button
--------------------------------------------- */
 
.pinterest-button iframe {
	    margin: 10px 0;
}
<?php
 
//* Add Vertical Pinterest button
add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
function sp_custom_pinterest_button() {
     
	    printf( '<div class="pinterest-button"><a href="http://pinterest.com/pin/create/button/?url=%s&media=%s" class="pin-it-button" count-layout="vertical">Pin It</a><script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script></div>', urlencode( get_permalink() ), urlencode( genesis_get_image( array( 'format' => 'url' ) ) ) );
 
}
 
genesis();
<?php
 
//* Add No-count Pinterest button
add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
function sp_custom_pinterest_button() {
     
	    printf( '<div class="pinterest-button"><a href="http://pinterest.com/pin/create/button/?url=%s&media=%s" class="pin-it-button" count-layout="none">Pin It</a><script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script></div>', urlencode( get_permalink() ), urlencode( genesis_get_image( array( 'format' => 'url' ) ) ) );
 
}
 
genesis();
<?php

//* Add Horizontal Pinterest button
add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
function sp_custom_pinterest_button() {
     
	    printf( '<div class="pinterest-button"><a href="http://pinterest.com/pin/create/button/?url=%s&media=%s" class="pin-it-button" count-layout="horizontal">Pin It</a><script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script></div>', urlencode( get_permalink() ), urlencode( genesis_get_image( array( 'format' => 'url' ) ) ) );
 
}
 
genesis();
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
<?php

add_action( 'genesis_entry_content', 'sp_custom_pinterest_button', 5 );
function sp_custom_pinterest_button() {
	
	/** Horizontal */
	printf( '<div class="pinterest-button"><a href="http://pinterest.com/pin/create/button/?url=%s&media=%s" class="pin-it-button" count-layout="horizontal">Pin It</a><script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script></div>', urlencode( get_permalink() ), urlencode( genesis_get_image( array( 'format' => 'url' ) ) ) );

}

add_action( 'genesis_post_content', 'sp_custom_pinterest_button_after' );
function sp_custom_pinterest_button_after() {
	
	/** Horizontal */
	printf( '<div class="pinterest-button"><a href="http://pinterest.com/pin/create/button/?url=%s&media=%s" class="pin-it-button" count-layout="horizontal">Pin It</a><script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script></div>', urlencode( get_permalink() ), urlencode( genesis_get_image( array( 'format' => 'url' ) ) ) );

}

genesis();
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

add_action( 'genesis_entry_content', 'sp_custom_pinterest_button' );

以上是关于php Pinterest“Pin It”按钮。的主要内容,如果未能解决你的问题,请参考以下文章

将 Pin it 按钮放置在 Pinterest 插件的图像顶部

如何使用 iOS Pin It SDK 在 Pinterest 中实现 Followboard 按钮功能?

html Pin It Hover Button #pinterest

php Genesis Pinterest按钮。

php Jan Dembowski过滤the_content()以添加Pinterest按钮代码。

WordPress Pretty Photo Pin It 按钮的问题